ASP.NET Core MVC is a cross-platform, open-source web application framework used to build dynamic web applications using the Model-View-Controller (MVC) architectural pattern.
This question bank covers ASP.NET Core MVC fundamentals, controllers, action methods, routing, model binding, validation, dependency injection, middleware, filters, Razor Views, Tag Helpers, authentication, authorization, performance, testing, deployment, and practical interview scenarios.
Section 1: ASP.NET Core MVC Fundamentals (Basic)
What is ASP.NET Core MVC?
What is the MVC design pattern?
Explain the responsibilities of Model, View, and Controller.
What are the advantages of using MVC?
What is the difference between ASP.NET MVC 5 and ASP.NET Core MVC?
What are the major features of ASP.NET Core MVC?
What is the role of the
Microsoft.AspNetCore.Mvcnamespace?What is the purpose of the
Program.csfile?What is the role of
WebApplicationBuilder?What is the difference between
AddControllers()andAddControllersWithViews()?What is the difference between MVC and Razor Pages?
What is the difference between MVC and Minimal APIs?
Section 2: Controllers and Action Methods (Basic)
What is a Controller in ASP.NET Core MVC?
What are the naming conventions for Controllers?
What is an Action Method?
What is the difference between
ControllerandControllerBase?What is the purpose of the
IActionResultinterface?What is the difference between
IActionResultandActionResult<T>?What are Action Results?
What is the difference between
View()andRedirectToAction()?What is the difference between
Redirect()andRedirectToAction()?What is the purpose of
ViewResult?What is the difference between
ContentResultandJsonResult?What are
NotFound(),BadRequest(), andOk()?Can an Action Method be asynchronous?
What is the purpose of
Task<IActionResult>?What is the difference between
return View()andreturn PartialView()?
Section 3: Models and Views (Basic)
What is a Model in ASP.NET Core MVC?
What is the difference between a Model and a ViewModel?
What is a strongly typed View?
How do you pass data from a Controller to a View?
What is the difference between ViewData, ViewBag, and TempData?
What is the purpose of the
@modeldirective?What is the Razor View Engine?
What is the purpose of the
.cshtmlfile?What is the difference between a Layout and a Partial View?
What is the purpose of
_ViewStart.cshtml?What is the purpose of
_ViewImports.cshtml?What are Razor syntax and Razor expressions?
What is the difference between
@Html.DisplayFor()and@Html.EditorFor()?
Section 4: Routing in ASP.NET Core MVC (Intermediate)
What is Routing in ASP.NET Core MVC?
What is the difference between Conventional Routing and Attribute Routing?
How do you configure a default route in
Program.cs?What is the purpose of
MapControllerRoute()?What is the purpose of
MapControllers()?What is Endpoint Routing?
What are Route Constraints?
How do you define optional parameters in route templates?
How do you define default values in routes?
What is the purpose of the
[Route]attribute?What is the difference between
[HttpGet],[HttpPost],[HttpPut], and[HttpDelete]?What is the purpose of the
[ActionName]attribute?What are route tokens such as
[controller]and[action]?How do you generate URLs using
Url.Action()?What are Areas in ASP.NET Core MVC?
Section 5: Model Binding and Validation (Intermediate)
What is Model Binding?
How does Model Binding work internally?
What are the different sources from which MVC binds request data?
What is the difference between
[FromRoute],[FromQuery],[FromForm], and[FromBody]?What is Model Validation?
What is the purpose of Data Annotations?
What is the difference between client-side and server-side validation?
What is the purpose of
ModelState.IsValid?What happens when ModelState is invalid?
What is the difference between
[Required],[StringLength], and[RegularExpression]?How do you implement custom validation attributes?
What is the purpose of
IValidatableObject?What is the difference between Model Binding and Model Validation?
How do you handle validation errors in a Razor View?
What is the purpose of
ModelState.AddModelError()?
Section 6: Dependency Injection and Middleware (Intermediate)
What is Dependency Injection in ASP.NET Core MVC?
How do you inject a service into a Controller?
What are Transient, Scoped, and Singleton service lifetimes?
What is the difference between Scoped and Transient services?
What is a captive dependency?
Can we inject a service directly into a Razor View?
What is Middleware in ASP.NET Core?
What is the difference between Middleware and MVC Filters?
What is the request processing pipeline?
What is the importance of middleware execution order?
What is the purpose of
UseRouting()?What is the purpose of
UseAuthentication()andUseAuthorization()?What is the difference between
UseAuthentication()andUseAuthorization()?What is the purpose of
UseExceptionHandler()?How do you create custom middleware?
Section 7: Filters in ASP.NET Core MVC (Intermediate)
What are Filters in ASP.NET Core MVC?
What are the different types of MVC Filters?
What is the difference between Authorization Filters and Action Filters?
What is an Action Filter?
What is an Exception Filter?
What is a Resource Filter?
What is a Result Filter?
What is the execution order of MVC Filters?
How do you create a custom Action Filter?
What is the difference between
IActionFilterandIAsyncActionFilter?How do you register filters globally?
What is the purpose of the
[ServiceFilter]attribute?What is the purpose of the
[TypeFilter]attribute?What is the difference between
ServiceFilterandTypeFilter?When should you use Middleware instead of Filters?
Section 8: Razor, Tag Helpers, and View Components (Intermediate)
What are Tag Helpers in ASP.NET Core MVC?
What is the difference between HTML Helpers and Tag Helpers?
What is the purpose of
asp-controllerandasp-action?What is the purpose of
asp-for?What is the purpose of
asp-validation-for?What is the purpose of
asp-validation-summary?What is the purpose of
@addTagHelper?What are Partial Views?
What is the difference between Partial Views and View Components?
What is a View Component?
How do you create and invoke a View Component?
What is the purpose of
ViewComponentandViewComponentResult?Can a View Component use Dependency Injection?
What is the purpose of Sections in a Razor Layout?
What is the difference between
RenderBody()andRenderSection()?
Section 9: Security and Authentication (Advanced)
What is Authentication in ASP.NET Core MVC?
What is Authorization?
What is the difference between Authentication and Authorization?
What is Cookie-Based Authentication?
How do you configure Cookie Authentication?
What is the purpose of the
[Authorize]attribute?What is the purpose of the
[AllowAnonymous]attribute?What is Role-Based Authorization?
What is Policy-Based Authorization?
What is Claims-Based Authorization?
What is the difference between Role-Based and Policy-Based Authorization?
How does ASP.NET Core MVC integrate with Microsoft Entra ID?
What is Cross-Site Request Forgery (CSRF)?
How does the
[ValidateAntiForgeryToken]attribute work?What is the purpose of
@Html.AntiForgeryToken()?What is Cross-Site Scripting (XSS)?
How does Razor prevent XSS attacks?
What is Content Security Policy (CSP)?
How do you securely store application secrets?
What are the best practices for securing an MVC application?
Section 10: Application Architecture and Configuration (Advanced)
What is the difference between
appsettings.jsonandappsettings.Development.json?How does environment-specific configuration work?
What is the Options Pattern?
What is the difference between
IOptions<T>,IOptionsSnapshot<T>, andIOptionsMonitor<T>?What is the purpose of
IConfiguration?How do you implement the Repository Pattern in ASP.NET Core MVC?
What is the Unit of Work Pattern?
Why should business logic not be written directly inside Controllers?
How do you implement Global Exception Handling?
What is the difference between
UseExceptionHandler()and Exception Filters?What is the purpose of logging through
ILogger<T>?How do you implement structured logging?
What is the difference between
IWebHostEnvironmentandIHostEnvironment?What is the purpose of
IHttpContextAccessor?How do you access the current user's claims inside a Controller?
Section 11: Performance and State Management (Advanced)
What is Response Caching?
What is Output Caching?
What is the difference between Response Caching and Output Caching?
How do you implement caching in ASP.NET Core MVC?
What is the difference between In-Memory Cache and Distributed Cache?
What is Session State?
How do you configure Session in ASP.NET Core MVC?
What is the difference between Cookies and Session?
What is TempData, and how does it work across redirects?
What is the purpose of
TempData.Keep()andTempData.Peek()?How do you improve MVC application performance?
How do asynchronous Action Methods improve scalability?
What is Response Compression?
How do you implement pagination in MVC applications?
How do you prevent unnecessary database queries in Controllers?
Section 12: File Handling and HTTP (Advanced)
How do you upload files in ASP.NET Core MVC?
What is
IFormFile?What is the difference between
IFormFileandIFormFileCollection?How do you upload multiple files?
How do you download a file from an MVC Action Method?
What is the difference between
FileResultandPhysicalFileResult?How do you validate uploaded files securely?
How do you implement large file uploads?
How do you handle HTTP status codes in MVC?
What is Content Negotiation?
Section 13: Testing and Deployment (Advanced)
How do you perform unit testing of MVC Controllers?
What is the difference between Unit Testing and Integration Testing?
How do you mock dependencies in Controller tests?
What is
WebApplicationFactory<TEntryPoint>?How do you perform integration testing of an MVC application?
How do you handle errors in production environments?
What is the purpose of Health Checks?
How do you deploy an ASP.NET Core MVC application to IIS?
What is the difference between In-Process and Out-of-Process hosting?
What is Kestrel?
What is the role of a reverse proxy?
How do you configure HTTPS in an MVC application?
What is Forwarded Headers Middleware?
How do you manage environment variables in production?
What are the best practices for deploying an MVC application?
Section 14: Scenario-Based and Practical Questions (Advanced)
How would you implement a centralized exception-handling mechanism for an MVC application?
How would you restrict access to specific Controller actions based on user roles?
How would you implement custom authorization based on user permissions?
How would you prevent duplicate form submissions?
How would you implement a multi-step form in MVC?
How would you maintain user data across multiple requests?
How would you implement server-side pagination and sorting?
How would you implement dynamic dropdowns using AJAX?
How would you return JSON from an MVC Controller?
How would you implement a global filter for logging execution time?
How would you handle concurrent updates to the same database record?
How would you implement file upload with file type and size validation?
How would you implement a common layout for multiple Areas?
How would you implement custom error pages for 404 and 500 errors?
How would you troubleshoot an MVC action that is not being invoked?
How would you troubleshoot a View that cannot be found?
How would you prevent over-posting or mass-assignment vulnerabilities?
How would you implement soft delete in an MVC application?
How would you implement audit logging for user activities?
How would you design an MVC application using Clean Architecture?
Important Note: ASP.NET Core MVC is different from classic ASP.NET MVC 5. ASP.NET Core MVC uses the modern .NET hosting model, built-in Dependency Injection, Middleware, Endpoint Routing, and the Microsoft.AspNetCore.Mvc framework. Do not confuse its APIs and configuration with those of classic MVC 5.
This question bank focuses on MVC-based web application development. Web API-specific topics such as REST API design, API versioning, JWT implementation for APIs, and API rate limiting will be covered separately in our ASP.NET Core Web API interview question series.
Skills Tutorials – Learn • Build • Grow Together
Continue learning with our tutorials and interview preparation series.