-
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
-
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
-
How does C# code become IL? Explain lowering with examples such as foreach, using, lock, string concatenation and switch.
Roslyn lowering of high-level C# constructs into simpler C# and IL, and what Debug versus Release changes.
Mid-Level
Theory
Runtime Execution
Β· π 3 follow-ups Β· π 1 real-world
-
How does IL become machine code at run time, including how generic methods are compiled for reference and value types?
The path from IL to native code: method descriptors, precode and prestub, code heap, back-patching, and shared versus specialised generic code.
Senior
Theory
Runtime Execution
Β· π 3 follow-ups Β· π 1 real-world
-
Which optimisations does the .NET JIT perform, and how do you write code that lets it optimise well?
Inlining, constant folding, bounds-check elimination, devirtualisation, loop optimisations, struct promotion and escape analysis, and how to verify them.
Senior
Theory
Runtime Execution
Β· π 3 follow-ups Β· π 1 real-world
-
What is a method table (and the type object) in the CLR, and what is the in-memory layout of a .NET object?
Object header, MethodTable pointer and fields; MethodTable versus EEClass versus RuntimeType; minimum object size; inspecting with SOS.
Senior
Theory
Runtime Execution
Β· π 3 follow-ups Β· π 1 real-world
-
What are the object header and the sync block in .NET, and how do lock and GetHashCode use them?
Header bits for thin locks and hash codes, inflation to the sync block table, Monitor internals, and System.Threading.Lock.
Senior
Theory
Runtime Execution
Β· π 2 follow-ups Β· π 1 real-world
-
How does virtual method dispatch work in the CLR, and what does a virtual call cost compared with a direct call?
Vtable slots in the MethodTable, the instruction sequence of a virtual call, override versus new, sealed and devirtualisation.
Senior
Theory
Runtime Execution
Β· π 3 follow-ups Β· π 1 real-world
-
How does interface method dispatch work in the CLR, and why can it be slower than virtual dispatch?
Interface maps, virtual stub dispatch (indirection cells, dispatch and resolve stubs), default interface methods, constrained calls on structs.
Senior
Theory
Runtime Execution
Β· π 3 follow-ups Β· π 1 real-world
-
How does reflection work internally in .NET, why is it slow, and what are the faster alternatives?
RuntimeType and member caches, Invoke costs and the .NET 7/8 invoker improvements, delegates, compiled expressions, UnsafeAccessor and source generators.
Senior
Theory
Runtime Execution
Β· π 3 follow-ups Β· π 1 real-world
-
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
-
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
-
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
-
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
-
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
-
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
-
How does generational garbage collection work in .NET, and why does it make most collections cheap?
The generational hypothesis, Gen 0/1/2, promotion, card tables and write barriers, regions, and mark-sweep-compact.
Mid-Level
Theory
Garbage Collection
Β· π 4 follow-ups Β· π 1 real-world
-
What happens during a Gen 0 allocation and collection in .NET, and how do you reduce Gen 0 GC frequency?
Allocation contexts and bump-pointer allocation, the Gen 0 budget, what triggers a Gen 0 GC, allocation rate metrics and reducing allocations.
Mid-Level
Theory
Garbage Collection
Β· π 3 follow-ups Β· π 1 real-world
-
What is the role of Gen 1 in the .NET GC, and what is the "mid-life crisis" problem?
Gen 1 as a buffer between short- and long-lived objects, Gen 1 GCs, objects that die soon after reaching Gen 2, and how to fix mid-life lifetimes.
Senior
Theory
Garbage Collection
Β· π 2 follow-ups Β· π 1 real-world
-
What is a Gen 2 (full) garbage collection in .NET, what triggers it, and how do you investigate frequent Gen 2 GCs?
Full GCs, triggers (budget, LOH allocation, induced, low memory), blocking versus background, compaction, and a method to diagnose frequent Gen 2 collections.
Senior
Debugging
Garbage Collection
Β· π 3 follow-ups Β· π 1 real-world