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.
How C# becomes machine code, JIT optimisations, object layout (method tables, headers, sync blocks), virtual and interface dispatch, and reflection internals.
Roslyn lowering of high-level C# constructs into simpler C# and IL, and what Debug versus Release changes.
The path from IL to native code: method descriptors, precode and prestub, code heap, back-patching, and shared versus specialised generic code.
Inlining, constant folding, bounds-check elimination, devirtualisation, loop optimisations, struct promotion and escape analysis, and how to verify them.
Object header, MethodTable pointer and fields; MethodTable versus EEClass versus RuntimeType; minimum object size; inspecting with SOS.
Header bits for thin locks and hash codes, inflation to the sync block table, Monitor internals, and System.Threading.Lock.
Vtable slots in the MethodTable, the instruction sequence of a virtual call, override versus new, sealed and devirtualisation.
Interface maps, virtual stub dispatch (indirection cells, dispatch and resolve stubs), default interface methods, constrained calls on structs.
RuntimeType and member caches, Invoke costs and the .NET 7/8 invoker improvements, delegates, compiled expressions, UnsafeAccessor and source generators.