377 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.
MSBuild, build configurations, Debug vs Release, conditional compilation, source files, embedded resources, analysers, nullable context and TreatWarningsAsErrors.
MSBuild fundamentals: the evaluation and execution phases, properties, items and metadata, targets and their ordering, tasks, global properties, incremental builds with Inputs and Outputs, and how dotnet build maps onto MSBuild.
Build configurations: what Debug and Release change (optimisation, DEBUG/TRACE constants, debugging information, JIT behaviour), which commands default to which, custom configurations, and why behaviour can differ.
Conditional compilation in .NET: preprocessor directives, DefineConstants and implicit symbols (DEBUG, TFM and OS symbols), the [Conditional] attribute's call-site semantics, feature switches, and why most environment differences belong in run-time configuration.
Debugging Release-only bugs: the usual causes (removed debug-only code, JIT optimisations exposing races and non-volatile reads, shortened object lifetimes, timing), a systematic investigation with Release builds, logs, dumps and symbols, and preventing recurrence.
Build items for files: Compile, None, Content and EmbeddedResource, CopyToOutputDirectory and CopyToPublishDirectory, embedded resource naming and LogicalName, reading with GetManifestResourceStream, .resx localisation, and when to embed versus copy.
The .NET analyser ecosystem: built-in CA code quality analysers and IDE code style analysers, AnalysisLevel and AnalysisMode, EnforceCodeStyleInBuild, .editorconfig severities, third-party analyser packages, suppressions, and rolling stricter rules out to a team.
Adopting nullable reference types at scale: what <Nullable> does, annotations and warnings, flow analysis and attributes, a project-by-project or file-by-file migration plan, handling public APIs and EF Core, and making nullable warnings errors.
A code review of warning policy: TreatWarningsAsErrors versus WarningsAsErrors and WarningsNotAsErrors, NoWarn versus severities in .editorconfig, CI-only versus local enforcement, AnalysisLevel pinning, and ratcheting a legacy codebase to zero warnings.
Diagnosing slow and non-incremental builds: capturing binary logs with -bl, reading them in the MSBuild Structured Log Viewer, finding slow targets, tasks and analysers, spotting broken incrementality, and fixes such as Inputs/Outputs, caching and build server settings.