Interview questions
.NET Interview Questions
20 .NET and ASP.NET Core interview questions with model answers: C#, async, DI lifetimes, middleware, EF Core and LTS versions. For both sides.

What's here
20 .NET interview questions, grouped into 4 areas: platform and c# fundamentals, asp.net core, data access and ef core and design, testing and scenarios. Each one comes with why it is worth asking and what a strong answer contains, so the same question can be scored the same way by different interviewers.
- Ask candidates to explain a middleware ordering or DI lifetime bug they have seen; real stories beat textbook answers.
- Show a short EF Core query with an N+1 problem and ask how they would spot and fix it.
- Check that candidates know the current LTS release and the support dates for the versions your team runs.
Cohesyve finds, contacts and tests .NET candidates on the real work, then ranks them for these interviews. 14-day free trial for 10 candidates, not charged until it ends.
Preparing for this interview yourself? Practise it free →These .NET interview questions cover what C# and ASP.NET Core interviews test today: the modern .NET platform and its support releases, C# fundamentals such as value types and async/await, the ASP.NET Core middleware pipeline and dependency injection, Entity Framework Core, and testing and production scenarios. Candidates can use the 'what to look for' notes as model answers; interviewers can use them to score answers and decide where to dig deeper.
Platform and C# Fundamentals
The platform choices and language basics that every .NET developer should explain clearly.
- 1
What is the difference between .NET (formerly .NET Core), .NET Framework and .NET Standard?
Why ask it
Many companies run a mix of old and new .NET code.What to look for
.NET Framework is the older, Windows-only runtime kept for existing applications. Modern .NET (which grew out of .NET Core) is cross-platform, open source and where new development happens. .NET Standard is a specification of APIs that let a library work across both. New projects should target modern .NET. - 2
What are LTS and STS releases, and which .NET version would you pick for a new production service in 2026?
Why ask it
Checks awareness of support lifecycles, which affects security and upgrade planning.What to look for
Even-numbered releases are Long Term Support with three years of free support; odd-numbered are Standard Term Support with two years. .NET 10 is the current LTS, supported until November 2028, while .NET 8 and .NET 9 both reach end of support on 10 November 2026. A strong answer is .NET 10 for new work and a plan to move older services off 8 and 9. - 3
What is the difference between value types and reference types? When would you use a struct?
Why ask it
Affects performance, equality and bugs around copying.What to look for
Value types (int, structs, enums) hold their data directly and are copied on assignment; reference types (classes, strings, arrays) hold a reference to an object on the heap. Structs suit small, immutable values. Good answers mention boxing when a value type is treated as an object, and records for value-like equality. - 4
How does garbage collection work in .NET, and where does IDisposable fit?
Why ask it
Memory and resource handling matter for long-running services.What to look for
The GC is generational: short-lived objects are collected cheaply in younger generations and survivors are promoted; large objects are handled separately. The GC manages memory but not unmanaged resources such as file handles and connections, which need IDisposable and 'using' to release them promptly. - 5
What does async/await actually do, and how can it go wrong?
Why ask it
Async misuse causes deadlocks and thread-pool starvation.What to look for
await frees the thread while an I/O operation is in progress and resumes when it completes, letting a server handle more requests. Pitfalls: blocking on tasks with .Result or .Wait(), async void outside event handlers, forgetting to await, and wrapping CPU-bound work in Task.Run on a server without reason.
Before the .NET interviews, see who can do the work
Cohesyve finds and contacts .NET candidates from your job description and tests each one on an AI job simulation of the role, so these questions go to a ranked shortlist. 14-day free trial for 10 candidates, not charged until it ends.
ASP.NET Core
How web applications are built and wired together in modern .NET.
- 6
Explain the ASP.NET Core middleware pipeline. Why does order matter?
Why ask it
Misordered middleware is a common source of security and routing bugs.What to look for
Each middleware can act on the request, call the next one and act on the response on the way back. Order defines behaviour: for example, authentication must run before authorisation, and both before the endpoints they protect. A middleware that does not call next short-circuits the pipeline, as static file middleware does for file requests. - 7
What are the transient, scoped and singleton service lifetimes? What goes wrong if a singleton depends on a scoped service?
Why ask it
Lifetime mistakes cause subtle state and concurrency bugs.What to look for
Transient: a new instance each time it is requested. Scoped: one instance per request. Singleton: one instance for the app's lifetime, which must be thread-safe. Injecting a scoped service into a singleton makes it behave like a singleton, leaking state across requests; the fix is to create an explicit scope. EF Core's DbContext is registered as scoped by default. - 8
When would you use minimal APIs instead of controllers?
Why ask it
Shows familiarity with current ASP.NET Core styles.What to look for
Minimal APIs define endpoints with little ceremony and suit small services and microservices. Controllers group actions with shared conventions, filters and model binding, which can suit large APIs. Good candidates say both are valid and describe how they would keep either organised. - 9
How does configuration work in ASP.NET Core, and how do you handle secrets?
Why ask it
Configuration mistakes leak secrets or break deployments.What to look for
Configuration comes from layered providers (appsettings files per environment, environment variables, command line and others), bound to typed classes through the options pattern. Secrets should never be committed: use user secrets locally and a secret store or environment configuration in production. - 10
What is the difference between authentication and authorisation in ASP.NET Core?
Why ask it
Security basics for any web developer.What to look for
Authentication establishes who the user is (cookies, JWT bearer tokens, external identity providers); authorisation decides what they can do (roles, claims, policy-based rules). Good answers mention policies for anything beyond simple roles and validating token issuer, audience and expiry.
Data Access and EF Core
Most .NET applications are data-heavy, and EF Core is the common data access layer.
- 11
What is the difference between IEnumerable and IQueryable?
Why ask it
Getting this wrong pulls whole tables into memory.What to look for
IEnumerable runs operations in memory on objects already loaded. IQueryable builds an expression tree that a provider such as EF Core translates into SQL, so filters run in the database. Calling ToList too early, or casting to IEnumerable before filtering, moves work into the application. - 12
What is the N+1 query problem in EF Core, and how do you fix it?
Why ask it
A very common cause of slow APIs.What to look for
Loading a list, then triggering a separate query for each item's related data. Fixes: eager loading with Include, projecting only needed fields with Select, or split queries where appropriate. Strong candidates check the generated SQL through logging and use AsNoTracking for read-only queries. - 13
How do you manage database schema changes in a team?
Why ask it
Tests production habits, not only coding.What to look for
EF Core migrations checked into source control, reviewed like code, and applied through a controlled deployment step, often as generated SQL scripts. Backwards-compatible changes (add a column, then remove the old one later) avoid downtime during rolling deployments. - 14
What is deferred execution in LINQ?
Why ask it
Explains surprising behaviour and repeated queries.What to look for
Most LINQ queries do not run when defined; they run when enumerated (foreach, ToList, Count). Enumerating twice runs the query twice. Materialise once when you need a stable result, and be aware of closures capturing variables that change before enumeration. - 15
How do you handle two users editing the same record at the same time?
Why ask it
Concurrency handling shows data integrity awareness.What to look for
Optimistic concurrency with a concurrency token or row version column: EF Core includes it in the update and throws a concurrency exception if the row changed. The app then reloads, merges or asks the user. Pessimistic locking is rarer and has costs.
Design, Testing and Scenarios
Engineering judgement for mid-level and senior .NET developers.
- 16
How do you test an ASP.NET Core application?
Why ask it
Testing habits predict maintainability.What to look for
Unit tests with a framework such as xUnit or NUnit for business logic, using fakes or mocks for dependencies; integration tests using WebApplicationFactory to run the app in memory against a test database or container. Good candidates keep business logic out of controllers so it is easy to test. - 17
How do you add logging and observability to a .NET service?
Why ask it
Production support depends on it.What to look for
ILogger with structured logging and sensible levels, correlation IDs across requests, metrics and distributed tracing (for example with OpenTelemetry), health checks, and alerts on symptoms users feel, such as error rates and latency. - 18
An API endpoint becomes slow under load. How do you investigate?
Why ask it
A realistic performance scenario.What to look for
Reproduce and measure first: traces and metrics to find where time goes, then check database queries (N+1, missing indexes), sync-over-async blocking, thread-pool starvation, excessive allocations and external calls without timeouts. Use profiling tools before optimising code. - 19
When would you use an interface and when an abstract class?
Why ask it
Basic design judgement.What to look for
Interfaces define a contract a class can implement alongside others and suit dependency injection and testing. Abstract classes share implementation and state between closely related types. Good answers avoid adding an interface for every class by reflex. - 20
How would you approach migrating a .NET Framework application to modern .NET?
Why ask it
Many employers are mid-migration.What to look for
Inventory dependencies and Windows-only APIs, move shared libraries first, migrate incrementally (one service or project at a time, sometimes running side by side behind a proxy), keep tests running throughout, and plan for differences in configuration, hosting and ASP.NET pipelines.
Running the interview well
- 1Ask candidates to explain a middleware ordering or DI lifetime bug they have seen; real stories beat textbook answers.
- 2Show a short EF Core query with an N+1 problem and ask how they would spot and fix it.
- 3Check that candidates know the current LTS release and the support dates for the versions your team runs.
- 4Include an async/await scenario, such as a blocking .Result call, and ask what can happen.
- 5For senior roles, discuss architecture, migrations from .NET Framework and production incidents.
- 6Let candidates use documentation for exact API names; score design and reasoning.
Common questions
What do .NET interviews usually cover?
C# fundamentals (types, generics, LINQ, async/await), the .NET platform and versions, ASP.NET Core middleware, dependency injection and configuration, EF Core, testing and performance troubleshooting.
How should I prepare for an ASP.NET Core interview?
Build a small API with authentication, EF Core and tests, then practise explaining the middleware pipeline, DI lifetimes and how a request flows through your app. Read the official ASP.NET Core fundamentals documentation, since many questions follow it closely.
Which .NET version should I learn in 2026?
Learn on the current LTS release, .NET 10, which is supported until November 2028. Many employers still run .NET 8 or .NET Framework code, so be ready to discuss upgrades.
Are .NET Core interview questions still relevant?
Yes. '.NET Core' is the older name for what is now just '.NET', so .NET Core questions are about the modern, cross-platform platform. The concepts carry over.
Do .NET interviews include live coding?
Often. Expect a C# problem using collections and LINQ, or a small API task. Some interviews instead ask you to review code and spot bugs, such as async misuse or N+1 queries.
What C# features should I know for interviews?
Generics, LINQ, async/await, nullable reference types, records, pattern matching, interfaces and abstract classes, exception handling and the 'using' statement.
Save these questions for the .NET candidates who can do the work
Cohesyve takes your .NET job description, finds candidates, reaches out to them and runs an AI job simulation of the real work, then returns a ranked shortlist.
1,500+
assessments completed
50%
faster time-to-hire
5 min
from JD to assessment
14-day free trial · 10 candidates · Not charged until the trial ends
Preparing for a .NET interview yourself? Practise on an AI job simulation of the role. 3-day free trial, cancel anytime.
From the blog