In this article
The runtime
What is the Common Language Runtime (CLR)?
The Common Language Runtime (CLR) is the runtime of .NET (the Microsoft developer platform): the part that loads and runs your compiled code and provides services around it. Code produced by a compiler that targets it is called managed code. Microsoft lists benefits such as cross-language integration, cross-language exception handling, enhanced security, versioning and deployment support, and debugging and profiling services (Microsoft Learn, CLR overview, read October 2026).
Why it is asked: it checks that you know what runs your code, not only how to write it. Read the full explanation: CLR overview.
What is managed code?
Managed code is code written with a language compiler that targets the runtime (Microsoft Learn, CLR overview, read October 2026). Because the runtime controls it, the code gets the runtime's services, such as exception handling across languages and automatic memory management, without writing them yourself.
Why it is asked: it is the vocabulary of every later question about memory and safety. Read the full explanation: CLR overview.
Why can different languages share one runtime?
The type system, the format of metadata and the runtime environment (the virtual execution system) are all defined by a public standard, the Common Language Infrastructure specification, so any compiler that follows it produces output the runtime can consume (Microsoft Learn, CLR overview, read October 2026). That shared contract is why a library written in one .NET language can be used from another.
Why it is asked: it separates people who know the platform's design from people who know one language. Read the full explanation: CLR overview.
What is metadata, and what does the runtime use it for?
Metadata is descriptive information stored with the code; every loadable executable file for the runtime contains it. The runtime uses it to locate and load classes, lay out instances in memory, resolve method invocations, generate native code, enforce security and set runtime context boundaries (Microsoft Learn, CLR overview, read October 2026).
Why it is asked: it shows you know why a compiled .NET file is self-describing. Read the full explanation: CLR overview.
Memory and garbage collection
How does the .NET garbage collector work with generations?
The garbage collector (GC) is the runtime component that reclaims memory from objects the program no longer uses. It divides the managed heap into three generations, 0, 1 and 2, so it can handle long-lived and short-lived objects separately. New objects go into generation 0, and objects that survive collections are promoted to generations 1 and 2 (Microsoft Learn, GC fundamentals, read October 2026).
Why it is asked: generations are the core of the GC's design. Read the full explanation: Fundamentals of garbage collection.
Why does the GC split the heap into generations?
Short-lived and long-lived objects behave differently, and separating them lets the collector treat each kind on its own terms. The frequency and duration of collections come from the volume of allocations and the amount of memory that survives on the managed heap (Microsoft Learn, GC fundamentals, read October 2026). So allocating less, or letting objects die young, reduces collection work.
Why it is asked: it tests whether you can connect the design to a performance consequence. Read the full explanation: Fundamentals of garbage collection.
What is the large object heap?
The large object heap (LOH) holds large objects and is sometimes referred to as generation 3. Objects on it are collected together with generation 2 (Microsoft Learn, GC fundamentals, read October 2026). An object of 85,000 bytes or more is a large object and goes on the LOH; the LOH is swept rather than compacted by default, because copying large objects is expensive (Microsoft Learn, large object heap, read October 2026).
Why it is asked: it probes whether you know that big allocations have a different cost. Read the full explanation: Fundamentals of garbage collection.
Does the garbage collector compact memory?
Yes. The reclaiming process compacts live objects so that they are moved together, and the dead space is removed, which makes the heap smaller (Microsoft Learn, GC fundamentals, read October 2026). Moving objects means the runtime, not your code, decides where an object lives in memory.
Why it is asked: it checks that you know the GC does more than free memory. Read the full explanation: Fundamentals of garbage collection.
What is background garbage collection?
In background garbage collection, the younger generations, 0 and 1, are collected as needed while the collection of generation 2 is in progress (Microsoft Learn, background GC, read October 2026). The point is that a long collection of old objects does not have to stop all work on new ones.
Why it is asked: it separates candidates who read beyond the basics of the collector. Read the full explanation: Background garbage collection.
Does setting an object to null free its memory straight away?
No. The garbage collector's optimizing engine determines the best time to perform a collection, based upon the allocations being made (Microsoft Learn, garbage collection, read October 2026). Dropping the last reference makes the object eligible for collection, but the collector decides when memory is actually reclaimed. Unmanaged resources such as file handles are released deterministically by calling Dispose, usually through a using statement, not by the garbage collector (Microsoft Learn, clean up unmanaged resources, read October 2026).
Why it is asked: it catches the common belief that you control when memory is freed. Read the full explanation: Garbage collection.
Knowing it is half the job. Saying it is the other half.
Interview Clozo is an AI interview copilot for real interview rounds: it hears the question and puts a strong answer on your screen, and you say it in your own words. See the features or how it works.
Start Free Trial →Dependency injection
What is dependency injection, and what does .NET provide for it?
Dependency injection (DI) is a technique in which a class receives the objects it depends on from outside instead of creating them itself. .NET provides a built-in service container, IServiceProvider (Microsoft Learn, dependency injection in .NET, read October 2026). You register services with a chosen lifespan, and the container creates and disposes them.
Why it is asked: DI is the default structure of modern .NET applications. Read the full explanation: Dependency injection in .NET.
What are the transient, scoped and singleton service lifespans?
A service lifespan is the rule that says how long the container keeps one instance of a service. A transient service is a new instance each time it is requested. Scoped objects are the same for a given request but differ across new requests, and singleton objects are the same for every request (Microsoft Learn, web-app dependency injection page, read October 2026). A singleton is not disposed until the app shuts down (Microsoft Learn, DI in .NET).
Why it is asked: lifespans decide correctness and memory use. Read the full explanation: dependency injection in web apps.
How many instances does each lifespan create for two requests?
Take two web requests that each resolve the same service twice (an illustrative setup). A transient service gives four instances, a scoped service two, and a singleton one.1 The counts follow from the definitions above: transient creates one per resolution, scoped one per request, singleton one for the whole app.
Text description of the diagram
- A transient service gives four instances, a scoped service two, and a singleton one.
- Transient creates one per resolution, scoped one per request, singleton one for the whole app.
Why it is asked: it turns a definition into a prediction you can do on a whiteboard. Read the full explanation: Web-app dependency injection page.
What goes wrong if a scoped service is injected into a singleton?
A scoped service resolved from the root container is effectively promoted to a singleton: it is disposed only by the root container when the app shuts down, so it lives as long as the app (Microsoft Learn, DI in .NET, read October 2026). The same trap appears when a singleton takes a scoped service in its constructor, because the singleton then holds that instance for the life of the app (a captive dependency). The rule is that scoped services are not injected into singletons, and the default provider checks for this in the Development environment.
Why it is asked: it is a classic lifespan bug that works in a demo and misbehaves under load. Read the full explanation: Dependency injection in .NET.
Why does a scoped service fail in middleware constructor injection?
Middleware is built once for the app, so constructor injection forces a scoped service to behave like a singleton, and using it throws a runtime exception (Microsoft Learn, DI in the web framework, read October 2026). The documented fix is to inject the scoped service into the Invoke or InvokeAsync method, or to use factory-based middleware.
Why it is asked: it shows you have met the lifespan rules in a real request pipeline. Read the full explanation: Web-app dependency injection page.
Versions and support
What is the difference between LTS and STS releases?
Each .NET release is defined as either Standard Term Support (STS) or Long Term Support (LTS) at the beginning of the release. LTS releases get free support and patches for three years, and STS releases for two years (Microsoft, .NET support policy, read October 2026). STS releases were previously known as Current releases.
Why it is asked: choosing a version for production is a real engineering decision. Read the full explanation: the official .NET support policy.
Is an STS release lower quality or a beta?
No. Microsoft states that the quality of all releases is exactly the same and the only difference is the length of support (Microsoft, .NET support policy, read October 2026). The right question is how long you can stay on a version before you must upgrade.
Why it is asked: it tests whether you repeat a myth or check the policy. Read the full explanation: the official .NET support policy.
How long is an STS release supported: 18 or 24 months?
Twenty-four months. Microsoft increased support for Standard Term Support releases from 18 months to 24 months (.NET Blog, STS releases supported for 24 months, read October 2026), and the policy page now says two years (Microsoft, .NET support policy). Older articles that say 18 months are out of date.
Why it is asked: it reveals whether your knowledge is current. Read the full explanation: the official .NET support policy.
When are new .NET versions released, and which are LTS?
New major versions are released annually in November. STS releases come in even-numbered years and LTS releases in odd-numbered years (dotnet/core release policies, read October 2026). That matches .NET 8, released in 2023, and .NET 10, released in 2025, as LTS, and .NET 9, released in 2024, as STS (Microsoft, support policy).
Why it is asked: it checks that you can plan upgrades from the cadence. Read the full explanation: dotnet/core release policies.
Which .NET versions are supported right now, and when does support end?
As of October 2026, .NET 10 is an LTS release supported until November 14, 2028. .NET 8 (LTS) and .NET 9 (STS) both reach end of support on November 10, 2026 (Microsoft, support policy, read October 2026), and Microsoft recommends upgrading to .NET 10 (.NET Blog). From 26 October 2026 that is 15 days away for .NET 8 and .NET 9.1 Recheck the policy table before an interview, because it changes.
Why it is asked: it shows whether you track the platform you work on. Read the full explanation: the official .NET support policy.
Why do the support end dates not equal release date plus three or two years?
The dates are set by policy rather than counted from the release day: .NET 8 was released November 14, 2023 and ends November 10, 2026, and .NET 9 was released November 12, 2024 and ends on the same day (Microsoft, support policy, read October 2026). The computed windows are about 1,092 and 728 days.1 End of support falls on a Patch Tuesday, the second Tuesday of the month, which is why November 10, 2026 and November 14, 2028 are the dates (.NET release policies, read October 2026); treat the policy table as the authority.
Why it is asked: it checks whether you rely on the table instead of mental arithmetic. Read the full explanation: the official .NET support policy.
Follow-up questions
What are the common .NET interview questions?
The twenty-one above cover the runtime, memory, dependency injection and versions. Questions about C# itself, such as value and reference types, async and await, and Language Integrated Query (LINQ), are on the C# interview questions page. For the routine of a coding round, read the coding interview guide.
Are .NET Core interview questions different from .NET interview questions?
.NET 5 was the next release of .NET Core after 3.1, and "Core" was dropped from the name to mark it as the main implementation of .NET; Microsoft's web framework kept "Core" in its name (Microsoft Learn, what's new in .NET 5, read October 2026). What the current support policy lists as supported is .NET 8, .NET 9 and .NET 10 (Microsoft, read October 2026), so answer for those versions and say which one you used.
What are .NET full stack developer interview questions?
Expect the questions here plus front-end ones. The full stack developer interview questions page covers that side, and JavaScript interview questions covers the language most front ends use.
What system design interview questions are asked to a .NET developer?
They are the same design problems as for any stack, and a strong answer shows where your platform's choices matter, such as service lifespans and the release you deploy. Tech lead and engineering manager rounds add people and planning questions. If you also work on the Java Virtual Machine (JVM), compare with the Java interview questions.
- The CLR runs managed code and uses metadata to load, lay out and call it.
- The GC has three generations, collects the large object heap with generation 2, and decides when to collect.
- Transient, scoped and singleton differ in how many instances they create; scoped inside a singleton becomes a singleton.
- STS and LTS differ only in support length: two years against three.
- Check the support table before you answer: .NET 8 and .NET 9 end on November 10, 2026.
Sources
- Large object heap (Microsoft Learn) — Microsoft Learn, 26 Oct 2026
- Clean up unmanaged resources (Microsoft Learn) — Microsoft Learn, 26 Oct 2026
- What's new in .NET 5 (Microsoft Learn) — Microsoft Learn, 26 Oct 2026
- Common Language Runtime (CLR) overview (Microsoft Learn) — Microsoft Learn, 26 Oct 2026
- Fundamentals of garbage collection (Microsoft Learn) — Microsoft Learn, 26 Oct 2026
- Background garbage collection (Microsoft Learn) — Microsoft Learn, 26 Oct 2026
- Garbage collection (Microsoft Learn) — Microsoft Learn, 26 Oct 2026
- Dependency injection in .NET (Microsoft Learn) — Microsoft Learn, 26 Oct 2026
- Dependency injection in ASP.NET Core (Microsoft Learn) — Microsoft Learn, 26 Oct 2026
- The official .NET support policy — Microsoft, 26 Oct 2026
- .NET 8 and .NET 9 will reach End of Support on November 10, 2026 — .NET Blog (Microsoft), 26 Oct 2026
- .NET STS releases supported for 24 months — .NET Blog (Microsoft), 26 Oct 2026
- .NET release policies (dotnet/core) — GitHub (.NET team), 26 Oct 2026