ASP.NET Core Interview

ASP.NET Core Fundamentals

ASP.NET Core interview questions covering asp.net core fundamentals.

25 Questions Filter by level

Interview questions

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

25 Results
1
JuniorBeginner

What is ASP.NET Core?

ASP.NET Core is Microsoft's cross-platform, open-source framework for building modern web applications, REST APIs, real-time applications, and backend services on .NET.

2
JuniorBeginner

What are the main advantages of ASP.NET Core?

Major advantages include cross-platform support, high performance, open-source development, a modular architecture, built-in dependency injection, unified configuration and logging, and first-class support for cloud and container deployments.

3
JuniorBeginner

How is ASP.NET Core different from the older ASP.NET Framework?

ASP.NET Core is cross-platform and runs on modern .NET, whereas classic ASP.NET Framework is primarily Windows-based and tightly coupled to the .NET Framework and System.Web.

4
JuniorBeginner

What is the role of Program.cs in an ASP.NET Core application?

Program.cs is the application entry point. In the modern hosting model, it creates the WebApplicationBuilder, registers services in the dependency injection container, builds the application, configures the HTTP request pipeline, maps endpoints, and starts the application.

5
JuniorBeginner

What is WebApplicationBuilder?

WebApplicationBuilder is the object used to configure an ASP.NET Core application before it is built. It exposes configuration, logging, environment information, host settings, and the IServiceCollection used for dependency injection.

6
JuniorBeginner

What is WebApplication in ASP.NET Core?

WebApplication represents the configured ASP.NET Core application after WebApplicationBuilder.Build() is called. It implements the application host and provides methods for configuring middleware and mapping endpoints.

7
JuniorBeginner

What is the ASP.NET Core request pipeline?

The request pipeline is the ordered sequence of middleware components through which each HTTP request and response passes.

8
JuniorBeginner

What is middleware in ASP.NET Core?

Middleware is software assembled into the HTTP pipeline to handle requests and responses. Each middleware component typically receives an HttpContext and a RequestDelegate representing the next component in the pipeline.

9
JuniorBeginner

What is Kestrel?

Kestrel is the cross-platform web server used by ASP.NET Core. It listens for HTTP requests and hosts the application's HTTP pipeline.

10
JuniorBeginner

What is a reverse proxy and why is it used with ASP.NET Core?

A reverse proxy is a server that receives client requests and forwards them to the ASP.NET Core application, usually running on Kestrel.

11
JuniorBeginner

What is dependency injection in ASP.NET Core?

Dependency injection is a design technique in which a class receives the services it depends on instead of constructing those services itself. ASP.NET Core includes a built-in dependency injection container.

12
JuniorBeginner

What are Transient, Scoped, and Singleton service lifetimes?

Transient services are created each time they are requested. They are suitable for lightweight, stateless services.

13
JuniorBeginner

What is IServiceCollection?

IServiceCollection is the collection used to register services with ASP.NET Core's dependency injection container during application startup.

14
JuniorBeginner

What is IServiceProvider?

IServiceProvider is the runtime service resolver built from the application's service registrations. ASP.NET Core uses it internally to create controllers and resolve registered dependencies.

15
JuniorBeginner

What is configuration in ASP.NET Core?

Configuration is the unified system used to read application settings from multiple providers. Common providers include appsettings.json, environment-specific JSON files, environment variables, command-line arguments, user secrets, and external configuration stores.

16
JuniorBeginner

What is appsettings.json?

appsettings.json is a conventional JSON configuration file used by ASP.NET Core applications. It commonly stores logging settings, connection-string names, application options, and other non-secret configuration.

17
JuniorBeginner

What is IConfiguration?

IConfiguration provides key/value access to the application's combined configuration sources. It supports hierarchical keys and sections and can be injected into application services.

18
JuniorBeginner

What is the Options pattern in ASP.NET Core?

The Options pattern binds related configuration values to a strongly typed class and makes them available through interfaces such as IOptions<T>, IOptionsSnapshot<T>, and IOptionsMonitor<T>.

19
JuniorBeginner

What are environments in ASP.NET Core?

Environments allow an ASP.NET Core application to change behavior and configuration according to where it is running. Common environment names are Development, Staging, and Production.

20
JuniorBeginner

What is IWebHostEnvironment?

IWebHostEnvironment provides information about the web hosting environment, including the environment name, application name, content root path, and web root path.

21
JuniorBeginner

What is the content root in ASP.NET Core?

The content root is the base path for application content files. Configuration files, Razor files, and other application-level resources are commonly resolved relative to it.

22
JuniorBeginner

What is the web root and wwwroot folder?

The web root is the base directory for public static web assets. By convention, ASP.NET Core uses the wwwroot folder as the web root.

23
JuniorBeginner

What is routing in ASP.NET Core?

Routing matches incoming HTTP requests to executable endpoints and can also generate URLs for application endpoints.

24
JuniorBeginner

What is endpoint routing?

Endpoint routing is the routing system that selects an Endpoint for an incoming request and exposes endpoint metadata to middleware and framework components.

25
JuniorBeginner

What is the difference between Map, Use, and Run in the middleware pipeline?

Use adds middleware that can perform work and optionally call the next component in the pipeline. Run adds terminal middleware that does not call a next component. Map branches the pipeline based on a request path prefix.