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

CLR Fundamentals

The Common Language Runtime, type system, assemblies, IL, JIT, tiered compilation, PGO, ReadyToRun, NativeAOT, trimming and assembly loading.

  1. What is the Common Language Runtime (CLR), and which services does it give your .NET application?

    The CLR as the execution engine of .NET: loading, JIT, type safety, GC, exceptions, threading and interop.

    Mid-Level Theory CLR Fundamentals Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  2. What is the Common Type System (CTS), and how does it let different .NET languages share types?

    The CTS rules for value and reference types, members, inheritance and how language keywords map to CTS types.

    Mid-Level Theory CLR Fundamentals Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  3. What is the Common Language Specification (CLS), and when should you mark a library as CLSCompliant?

    CLS rules for cross-language public APIs, the CLSCompliant attribute and the compiler warnings it enables.

    Mid-Level Theory CLR Fundamentals Β· πŸ”— 2 follow-ups Β· πŸ›  1 real-world
  4. What is a .NET assembly, and what does assembly identity (name, version, culture, public key token) mean in modern .NET?

    Assemblies as the unit of deployment and versioning, their contents, identity and how modern .NET treats versions and strong names.

    Mid-Level Theory CLR Fundamentals Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  5. What are metadata and the manifest in a .NET assembly, and how can you read them without loading the assembly?

    Metadata tables and tokens, the assembly manifest, type forwarding, and reading them with System.Reflection.Metadata.

    Senior Theory CLR Fundamentals Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  6. What is IL (Intermediate Language), and how do you read the IL the C# compiler produces?

    CIL as a stack-based instruction set, common opcodes, callvirt, boxing in IL, and tools to inspect it.

    Mid-Level Theory CLR Fundamentals Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  7. How does the JIT compiler work in .NET, and how can you see the machine code it generates?

    Just-in-time compilation per method via stubs, what the JIT produces, and inspecting output with DOTNET_JitDisasm.

    Senior Theory CLR Fundamentals Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  8. How does tiered compilation work in .NET, including Tier 0, Tier 1 and on-stack replacement (OSR)?

    Tiered JIT: quick unoptimised code first, call counting, background Tier 1 recompilation, OSR for loops and the settings that control it.

    Senior Theory CLR Fundamentals Β· πŸ”— 2 follow-ups Β· πŸ›  1 real-world
  9. What is Dynamic PGO in .NET, and how does guarded devirtualisation make interface and virtual calls faster?

    Profile-guided optimisation at run time: instrumentation, guarded devirtualisation, hot/cold layout and how traffic shape affects it.

    Senior Theory CLR Fundamentals Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  10. What is ReadyToRun (R2R), and when should you publish with it?

    ReadyToRun precompilation with crossgen2: startup benefits, size cost, version resilience, composite images and how it interacts with tiering.

    Mid-Level Theory CLR Fundamentals Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  11. What is NativeAOT in .NET, what does it give you and what are its restrictions?

    Native ahead-of-time compilation: startup and memory gains, required trimming, reflection and dynamic code limits, ASP.NET Core support and analysers.

    Senior Theory CLR Fundamentals Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  12. What does single-file publish do in .NET, and what breaks when you switch an app to it?

    PublishSingleFile bundling, framework-dependent versus self-contained, native library extraction, Assembly.Location and IL3000.

    Mid-Level Theory CLR Fundamentals Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  13. How does IL trimming work in .NET, and how do you make an app or library trim-safe?

    ILLink trimming, TrimMode, trim warnings, DynamicallyAccessedMembers and RequiresUnreferencedCode, feature switches and IsTrimmable.

    Senior Theory CLR Fundamentals Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  14. How does assembly loading work in .NET, and how do you debug a FileNotFoundException or FileLoadException for an assembly?

    Lazy loading, the TPA list from deps.json, resolution order and events, common load exceptions and the tools to trace loading.

    Senior Debugging CLR Fundamentals Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  15. What is AssemblyLoadContext, and how do you build an unloadable plugin system with it?

    Custom and collectible AssemblyLoadContext, AssemblyDependencyResolver, shared contracts and type identity, and diagnosing unload leaks.

    Senior Coding CLR Fundamentals Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world

🌐 Sangam's Webring

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