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 .NET runs your code: the CLR, assemblies, JIT and AOT, runtime type layout and dispatch, the Roslyn compilation pipeline, and garbage collection.
using statement versus declaration, lowering to try/finally, disposal order, pattern-based using for ref structs, and bugs with returned objects, deferred LINQ and Dispose exceptions.
IAsyncDisposable and ValueTask DisposeAsync, await using lowering, ConfigureAwait on disposal, the DisposeAsyncCore pattern, and DI async scopes.
Short and long weak references, WeakReference of T, ConditionalWeakTable for attached data, weak events, why weak caches are unreliable and their GC cost.
Confirming a leak, managed versus native growth, dotnet-counters, dotnet-gcdump comparisons, dotnet-dump and gcroot, common leak sources and verifying the fix.
Allocation rate and time in GC as pressure metrics, practical reduction techniques, GCConserveMemory, AddMemoryPressure for native allocations, and RefreshMemoryLimit.