.NET Framework & CLR Interview Questions and Answers
.NET runtime interview questions — CLR, CTS and CLS, managed vs unmanaged code, assemblies, the GAC, app domains and garbage collection.
21Questions
4Topics
Basic to AdvancedDifficulty
Fresher to 5+ YrsExperience
- 01 What is the difference between .NET Framework, .NET Core and .NET 5+? .NET Framework (4.x) — Windows-only, legacy, still supported but not evolving. .NET Core (1–3.1) — the cross-platform…
- 02 What is the difference between JIT and AOT compilation in .NET? JIT (Just-In-Time) compiles IL to native code at run time, the first time each method executes, and can re-optimise…
- 03 What is an assembly in .NET? An assembly is the unit of deployment, versioning and security in .NET — a compiled .dll or .exe containing IL, a…
- 04 What is reflection in .NET, and what are its costs? Reflection is inspecting and using type metadata at run time — discovering types, properties and attributes, creating…
- 05 What is string interning in .NET? Interning stores one shared instance of a string in an intern pool so identical string values reference the same…
- 06 Can you have a memory leak in .NET, and what causes it? Yes. The GC only collects unreachable objects, so anything still referenced — directly or indirectly — stays alive.…
- 07 What does the C# compiler produce, and what is IL? The C# compiler (Roslyn) doesn't produce machine code. It produces Intermediate Language (IL / CIL) plus metadata,…
- 08 What are the CTS and CLS? The CTS (Common Type System) defines how types are declared and used in the runtime, so all .NET languages share one…
- 09 Why does the .NET garbage collector use generations? Generational collection is based on the observation that most objects die young. New objects go in Gen 0, which is…
- 10 What is Span<T> and Memory<T>? Span<T> is a lightweight view over a contiguous region of memory — an array, a slice of one, a stackalloc buffer, or…
- 11 What is a NuGet package, and how do package versions and restore work? A NuGet package is a .nupkg archive containing compiled assemblies plus metadata, resolved from a feed (nuget.org, a…
- 12 What is AssemblyLoadContext, and how do plugins work in modern .NET? AssemblyLoadContext (ALC) is .NET Core's mechanism for loading assemblies in isolation — the replacement for .NET…
- 13 What is the stack and the heap, and what goes where in .NET? The stack is a fast, per-thread region for method call frames — parameters, local variables, return addresses — freed…
- 14 What is the thread pool, and why not just create threads? The thread pool is a managed set of reusable worker threads. Creating a raw Thread costs ~1MB of stack and kernel…
- 15 What synchronization primitives does .NET have (lock, Monitor, SemaphoreSlim, etc.)? lock (syntactic sugar over Monitor) — mutual exclusion for a short critical section, one thread at a time.…
- 16 What is the difference between a race condition and a deadlock? A race condition is when the result depends on the unpredictable timing of threads — e.g. two threads both check a…
- 17 What is a source generator in C#? A source generator is a Roslyn component that runs during compilation, inspects your code, and adds new source files…
- 18 How do culture and CultureInfo affect a .NET application? CultureInfo.CurrentCulture controls how numbers, dates and currency are formatted and parsed for a thread;…
- 19 What is the CLR (Common Language Runtime)? The CLR is the execution engine for .NET. It loads assemblies, JIT-compiles Intermediate Language (IL) to native…
- 20 What is the difference between managed and unmanaged code? Managed code runs under the CLR, which handles memory, type safety and exceptions — normal C#/.NET code. Unmanaged…
- 21 How does garbage collection work in .NET? The .NET GC is a generational, mark-and-compact collector. New objects go in Gen 0; objects that survive a collection…
No questions match those filters
Try removing a filter or .
About these .NET Framework & CLR questions
These questions cover the runtime that sits under every .NET language. Interviewers ask them to see whether you understand the platform, not just the syntax: what the CLR does when it loads an assembly, how JIT compilation works, what “managed” actually means, and how the generational garbage collector decides what to collect.
Even on .NET 8 projects these concepts still matter — the CLR, the type system and the GC work the same way, and legacy .NET Framework services are still common in enterprise codebases.