📁 Sangam Dhakal - Portfolio v2.0 - Netscape Navigator 4.0
_
□
×

πŸ“š .NET Interview Questions

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.

Build System

MSBuild, build configurations, Debug vs Release, conditional compilation, source files, embedded resources, analysers, nullable context and TreatWarningsAsErrors.

  1. What is MSBuild, and how do properties, items, targets and tasks fit together when you build a .NET project?

    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.

    Junior Theory Build System Β· πŸ”— 3 follow-ups
  2. What is the difference between Debug and Release builds in .NET, and why can code behave differently between them?

    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.

    Beginner Theory Build System Β· πŸ”— 3 follow-ups
  3. How does conditional compilation work in C#, and when should you use #if, DefineConstants or the [Conditional] attribute instead of run-time configuration?

    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.

    Intermediate Theory Build System Β· πŸ”— 3 follow-ups
  4. A bug only appears in the Release build in production and you can't reproduce it in Debug. How do you investigate and fix it?

    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.

    Mid-Level Debugging Build System Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  5. How do source files, content files and embedded resources work in a .NET build, and how do you read an embedded resource at run time?

    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.

    Intermediate Theory Build System Β· πŸ”— 3 follow-ups
  6. What analysers run during a .NET build, how do IDE code style rules differ from CA code quality rules, and how do you configure them across a team?

    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.

    Mid-Level Theory Build System Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  7. How would you enable nullable reference types across a large existing .NET codebase without stopping feature work?

    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.

    Senior RealWorldScenario Build System Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  8. Review this Directory.Build.props that turns on TreatWarningsAsErrors with a long NoWarn list. What would you change, and how should warnings-as-errors be used in a team?

    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.

    Mid-Level CodeReview Build System Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  9. Your team's builds have gone from 2 minutes to 15 and incremental builds rebuild everything. How do you find out why, using MSBuild binary logs?

    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.

    Senior Debugging Build System Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world

🌐 Sangam's Webring

βͺ Previous 🏠 Main Next ⏩
πŸ’¬ Chat with me