📁 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.

Compilation

The Roslyn compiler pipeline and authoring source generators, incremental generators, analysers and code fixes.

  1. How does the Roslyn compiler work, and how would you use the Roslyn APIs (syntax trees, semantic model, compilation) in your own tools?

    Roslyn's phases, immutable syntax trees, Compilation and SemanticModel, IOperation, emit, the compiler server and using the APIs to build tools.

    Senior Theory Compilation Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  2. How do you author a source generator in .NET, and how should the generator project be set up and packaged?

    Source generator authoring: IIncrementalGenerator, project setup (netstandard2.0, analyser references), post-initialisation output, debugging, packaging and pitfalls.

    Senior Coding Compilation Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  3. What makes a source generator incremental, and how do you keep a generator from slowing down the IDE?

    Incremental pipelines, caching and equality, ForAttributeWithMetadataName, avoiding symbols and syntax in models, and measuring generator performance.

    Senior Theory Compilation Β· πŸ”— 2 follow-ups Β· πŸ›  1 real-world
  4. How do you write a Roslyn analyser, and how do you test it and ship it to a team?

    Authoring DiagnosticAnalyzer: descriptors, registration actions, concurrency, generated code, testing with the Roslyn testing packages, severity configuration and packaging.

    Senior Coding Compilation Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  5. How do you write a Roslyn code fix provider, and what makes a code fix safe to apply across a whole solution?

    CodeFixProvider authoring: FixableDiagnosticIds, RegisterCodeFixesAsync, CodeAction with equivalence keys, syntax editing with trivia, Fix All and testing.

    Senior Coding Compilation Β· πŸ”— 2 follow-ups Β· πŸ›  1 real-world
  6. What are the options for build-time code generation in .NET, and how do you choose between source generators, MSBuild tasks, T4 templates and IL weaving?

    Comparing source generators, MSBuild-generated files (gRPC, OpenAPI), T4, IL weaving and interceptors for build-time code generation, with trade-offs.

    Senior Architecture Compilation Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world

🌐 Sangam's Webring

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