.
NET Interview Questions and Answers (Senior Developer)
1. Difference between .NET Framework and .NET Core / .NET 8
.NET Framework is Windows-only and mainly used for legacy applications. .NET Core and
now .NET 8 are cross-platform, high-performance, modular, and optimized for cloud and
microservices. .NET 8 is actively developed and supports modern application deployment.
2. What is Kestrel Server?
Kestrel is a cross-platform, high-performance web server used by default in [Link] Core
applications. It processes HTTP requests and is often used behind IIS or Nginx in production
environments.
3. Middleware in [Link] Core
Middleware components handle HTTP requests and responses in a pipeline. Examples
include authentication, logging, routing, and authorization. Each middleware component
can process or pass requests to the next component.
4. Dependency Injection in .NET Core
Dependency Injection (DI) is a design pattern where dependencies are injected into classes
instead of being created manually. It improves maintainability, scalability, and testability of
applications.
5. IServiceCollection vs IServiceProvider
IServiceCollection is used to register services during application startup, while
IServiceProvider is used to resolve and provide service instances during runtime.
6. What is async/await?
async and await keywords enable asynchronous programming, allowing long-running
operations such as database or API calls to run without blocking the main thread, improving
scalability and performance.
7. ConfigureServices vs Configure
ConfigureServices is used to register application services and dependencies, while
Configure defines the middleware pipeline that handles HTTP requests.
8. Minimal APIs vs MVC
Minimal APIs provide a lightweight way to build APIs with minimal configuration and are
ideal for microservices. MVC uses controllers and views, offering a more structured
architecture suitable for large, enterprise-level applications.