1325 questions for senior .NET engineer interviews, each with a 30-second answer, the full answer, a deep dive, the follow-ups interviewers ask next, and real-world production problems.
appsettings.json, environment-specific settings, user secrets, environment variables, command-line configuration, the options pattern, IOptions, IOptionsSnapshot, IOptionsMonitor and options validation.
A real-world migration of ASP.NET Core configuration to Azure Key Vault and Azure App Configuration with managed identity: inventory and classification, RBAC roles, AddAzureKeyVault versus App Configuration Key Vault references, labels per environment, sentinel-key refresh and Key Vault reload intervals, rotation with overlapping secret versions, passwordless Entra ID auth, start-up resilience and replicas, feature flags with Microsoft.FeatureManagement, and the rollout plan.
The ASP.NET Core configuration system: IConfiguration as a merged key-value view over ordered providers, the default sources added by WebApplication.CreateBuilder, last-provider-wins precedence, case-insensitive hierarchical keys with colon, double underscore for environment variables, array indexes and reading values with GetValue, GetSection and GetConnectionString.
ASP.NET Core environments: how the environment name is resolved (ASPNETCORE_ENVIRONMENT, DOTNET_ENVIRONMENT, --environment, default Production), IHostEnvironment and IsDevelopment/IsProduction/IsEnvironment, what changes in Development (developer exception page, user secrets, DI validation), appsettings.{Environment}.json selection, launchSettings.json, and what belongs outside appsettings.
The .NET Secret Manager: UserSecretsId in the project file, dotnet user-secrets init/set/list, the secrets.json location on Windows, Linux and macOS, loading only in the Development environment, why it is plain text outside the repo rather than encryption, and production replacements such as Azure Key Vault with managed identity and platform secret stores.
The options pattern: binding configuration sections to strongly typed classes with Configure<T>, AddOptions<T>().Bind/BindConfiguration, how ConfigurationBinder maps keys to properties (case-insensitive, conversions, collections, missing keys, ErrorOnUnknownConfiguration), IConfigureOptions and PostConfigure for code-based setup, the binding source generator for AOT, and why injecting IConfiguration into services is an anti-pattern.
IOptions, IOptionsSnapshot and IOptionsMonitor compared: singleton, scoped and singleton lifetimes, computed once versus per scope versus cached and rebuilt on change tokens, CurrentValue and OnChange, named options with Get(name), the captive-dependency error, the per-request rebinding cost of IOptionsSnapshot, and how to choose for singletons, request handlers and BackgroundService.
Options validation in ASP.NET Core: ValidateDataAnnotations and its reflection cost, Validate delegates, IValidateOptions<T> for cross-property and service-dependent rules, ValidateOnStart to fail at host start-up, ValidateObjectMembers and ValidateEnumeratedItems for nested types, the compile-time [OptionsValidator] source generator for AOT, OptionsValidationException behaviour on reload, and testing validators.
Diagnosing configuration values that don't take effect in Azure App Service, Container Apps or Kubernetes: environment variable naming (: versus __, ConfigMap key rules, App Service connection string prefixes), provider order and custom sources added last, the wrong environment name, values read once at start-up, mounted ConfigMap symlink swaps and DOTNET_USE_POLLING_FILE_WATCHER, and using GetDebugView with masking, the provider list, printenv and az CLI to find which provider won.
Code review of configuration anti-patterns: secrets committed in appsettings.json (incident response, rotation, history, Privacy Act and NDB), constructors that parse configuration and open connections, a static IConfiguration singleton (hidden dependencies, test pollution, no reload), no validation, and the rewrite with options classes, ValidateOnStart, Key Vault with managed identity and passwordless SQL, plus blocking versus suggested review comments and secret scanning.