C# Interview

ASP.NET Core, DI & Middleware

C# interview questions covering asp.net core, di & middleware.

10 Questions Filter by level

Interview questions

Open a question for the full answer, code and interview guidance.

10 Results
161
SeniorAdvanced

How does dependency injection work in ASP.NET Core?

ASP.NET Core includes a built-in dependency injection container. Services are registered in IServiceCollection during application startup and are resolved from IServiceProvider when required.

162
SeniorAdvanced

What is middleware in ASP.NET Core?

Middleware is software assembled into the HTTP request pipeline. Each middleware component can inspect or modify the request, perform work before and after the next component, and optionally terminate the pipeline.

163
SeniorAdvanced

What is the difference between middleware and filters in ASP.NET Core?

Middleware operates at the HTTP pipeline level and can apply broadly to requests regardless of MVC or controller execution.

164
SeniorAdvanced

What is configuration in ASP.NET Core?

ASP.NET Core configuration combines settings from providers such as appsettings.json, environment-specific JSON files, environment variables, command-line arguments, user secrets during development, and external configuration systems.

165
SeniorAdvanced

What is the Options Pattern in ASP.NET Core?

The Options Pattern maps configuration sections to strongly typed C# classes.

166
SeniorAdvanced

What is logging in ASP.NET Core?

ASP.NET Core provides the ILogger<T> abstraction for structured application logging.

167
SeniorAdvanced

What is global exception handling in ASP.NET Core?

Global exception handling centralizes the conversion of unhandled exceptions into consistent HTTP responses and logs.

168
SeniorAdvanced

What is model binding in ASP.NET Core?

Model binding converts incoming HTTP request data into C# action parameters or model objects.

169
SeniorAdvanced

What is model validation in ASP.NET Core?

Model validation verifies that incoming data satisfies declared validation rules.

170
SeniorAdvanced

What is the difference between authentication and authorization?

Authentication determines who the user is. Authorization determines what an authenticated or anonymous user is allowed to do.