ASP.NET Core Interview Questions and Answers

ASP.NET Core interview questions covering fundamentals, the request pipeline, middleware, dependency injection, service lifetimes, hosting and the full Dependency Injection follow-up chain.

13 questionsFree · Updated for 2026

ASP.NET Core interviews revolve around two things: the middleware pipeline and the built-in dependency injection container. This collection covers both, plus hosting and the exact Dependency Injection follow-up sequence many interviewers walk.

Fundamentals & hosting

3 questions
01What is ASP.NET Core?

ASP.NET Core is a free, open-source, cross-platform framework for building web apps, APIs and real-time services on .NET. It is a ground-up rewrite of ASP.NET that runs on Windows, Linux and macOS, is modular…

Read detailed answer
02What is the difference between ASP.NET MVC and ASP.NET Core?

ASP.NET MVC 5 runs only on the Windows .NET Framework, is hosted in IIS through System.Web, and needs third-party libraries for dependency injection. ASP.NET Core is cross-platform, self-hosted through…

Read detailed answer
03What is Kestrel in ASP.NET Core?

Kestrel is the default, cross-platform web server built into ASP.NET Core. It is a fast, lightweight HTTP server that listens for requests and hands them to your app's middleware pipeline. In production it is…

Read detailed answer

The request pipeline

3 questions
04What is middleware in ASP.NET Core?

Middleware is a component that sits in the request pipeline. Each piece of middleware receives the HttpContext, can do work before and after the rest of the pipeline, and then either calls next() to pass the…

Read detailed answer
05Explain the ASP.NET Core request pipeline.

A request enters through Kestrel, is handed to the middleware pipeline as an HttpContext, and passes through each middleware in registration order — exception handling, HTTPS redirection, static files,…

Read detailed answer
06What are filters in ASP.NET Core MVC/Web API?

Filters run code at specific stages of the MVC action pipeline, inside model binding and routing. The types, in order: Authorization → Resource → Action (before/after the action) → Exception → Result…

Read detailed answer

Dependency injection (the follow-up chain)

7 questions
07What is Dependency Injection in ASP.NET Core?

Dependency Injection (DI) is a design technique where a class receives the objects it depends on from the outside — usually through its constructor — instead of creating them itself. ASP.NET Core has a…

Read detailed answer
08What is loose coupling?

Loose coupling means a class depends on what another component does (an abstraction) rather than how it does it (a concrete implementation). Loosely coupled classes can be changed, replaced or tested…

Read detailed answer
09What is Inversion of Control (IoC)?

Inversion of Control is a principle where the flow of control — who creates objects, who calls whom — is handed to a framework or container instead of your own code. Dependency Injection is one form of IoC:…

Read detailed answer
10What are service lifetimes in ASP.NET Core?

A service lifetime controls how long the container keeps and reuses an instance. There are three: Transient — a new instance every time it is requested; Scoped — one instance per request (per DI scope);…

Read detailed answer
11What is the difference between Transient, Scoped and Singleton?

Transient: new instance on every injection — most short-lived. Scoped: one instance per request, shared within that request. Singleton: one instance for the app's entire lifetime, shared by every request and…

Read detailed answer
12Why is DbContext registered as Scoped?

DbContext is registered as Scoped because it is a lightweight, stateful, not thread-safe unit-of-work. One instance per request lets every repository and service in that request share the same change tracker…

Read detailed answer
13What is a captive dependency?

A captive dependency is when a longer-lived service holds a reference to a shorter-lived one, “capturing” it and keeping it alive far longer than intended. The classic case is a Singleton that injects a…

Read detailed answer
Back to the interview hub