In this blog post, I will share frequently most asked asp.net core interview questions and answers for experienced and freshers to get the right job. Find the list below:-
- Keep reading on ASP.NET MVC interview questions and answers 2020, Top 30 ASP.Net Web API Interview Questions
ASP.NET Core Interview Questions
Introducing ASP.NET Core
- What is the ASP.NET Core?
- What are the features provided by ASP.NET Core?
- What is Metapackages?
- What are the advantages of ASP.NET Core over ASP.NET?
- What is the startup class in ASP.NET core?
- What is the use of ConfigureServices method of startup class?
- What is the use of the Configure method of startup class?
Middleware and Routing
- How to add middleware to the application request pipeline?
- What is the difference between IApplicationBuilder.Use() and IApplicationBuilder.Run()?
- What is the use of the “Map” extension while adding middleware to the ASP.NET Core pipeline?
- What is the use of the “MapWhen” extension while adding middleware to the ASP.NET Core pipeline?
- What is middleware?
- How can we configure the pipeline for middleware?
- What is built-in middleware(s) with ASP.NET Core?
- Can we write our own middleware?
- What is routing in ASP.NET Core?
- How can we configure conventional routing?
- What’s happened MVC finds two disambiguating actions through routing?
- What is Attribute routing?
- Does ASP.NET Core support mix routing i.e. both conventional and attribute routing together?
- How can we define a route for areas?
Session and Environment Settings
- How to enable Session in ASP.NET Core?
- How many types of session state is available in ASP.NET Core?
- How to access the session in the ASP.NET Core application?
- Why Session is stored in the form of a byte array in ASP.NET Core?
- Is there any sequence to call UseSession() method in the Configure method?
- Can we store the Complex data into the session?
- How to set an environment variable?
- Key for environment variable is case-sensitive?
- How determine the value of an environment variable programmatically?
- What are the various JSON files available in ASP.NET Core?
- What is the use of the “launchsettings.json” file?
- What is the use of the “appsettings.json” file?
- What is the use of the “bower.json” file?
Razor Pages and View Component
- What are the Razor Pages in ASP.NET Core?
- How can we prevent Razor pages from XSRF/CSRF attack?
- How can we do an automatic model binding in Razor pages?
- How can we be binding the route data in Razor pages?
- What is the use of the ViewData attribute in Razor pages?
- How can we apply filters in Razor pages?
- What is the RCL (Razor Class Library) project?
- What happened if view, partial view, or Razor Page found in both RCL and web application?
- What is the view component in ASP.NET Core?
- What are the features provided by the ViewComponent?
- How can we create ViewComponent?
- What is the default path of view for ViewComponent?
- Can we have an invoked view component from the controller?
Model Binding and Validations
- What is Model binding?
- How does model binding work in the ASP.NET Core application?
- What are the characteristics of a complex type for binding the value?
- Can we control the behavior of Model binding using attributes?
- Can we create a custom model binder? If yes how?
- How can we use/register a custom model binder?
- How can we apply a custom model binder using the ModelBinder attribute?
- How can we apply custom model binder globally?
- How can we do model validation with ASP.NET Core?
- How can we check our model is valid or not at the controller level?
- Can we validate the model manually in the Controller class?
- How can we do Client-side validation?
Globalization and Localization
- What is Internationalization in ASP.NET Core?
- What is a resource file naming convention?
- How can we achieve localization in view?
- How can we access the localized resource string in the Controller?
- Can we localize error messages defined in Data Annotation?
Exception Handling and Logging Framework
- What is the “Developer Exception Page” in ASP.NET Core?
- How can we configure custom exception handling page in ASP.NET Core?
- How to configure the logging framework in ASP.NET Core?
- What are the possible values for Log level enum for the Logging framework?
- How many built-in extension methods provided by the logging framework of ASP.NET Core?
- What is the use of enum value LogLevel.None?
- How to set default minimum log level for Logging Framework?
- How to define filter rule for the Logging framework in ASP.NET Core?
- What is the logging scope in the Logging framework?
- What is third party logging framework that supported by ASP.NET Core?
Security and Filters
- What is the use of a filter in the ASP.NET Core application?
- Explain the filter types available in the ASP.NET Core application?
- In which sequence all the filters are invoked?
- How to create a custom filter?
- Does the filter support asynchronous implementation?
- How to implement the asynchronous filter in ASP.NET Core?
- Explain about the Filter scope?
- How to define a Global filter in ASP.NET Core?
- What is the Default order of filter execution?
- Can we override the default order of execution of filter in ASP.NET Core?
- Does the built-in filter also implement the interface IOrderFilter?
- Can we cancel the execution of filter or short-circuiting filters?
- Can we inject the dependency on the filter attribute?
- Can you apply a filter attribute having constructor dependency to the controller or action?
- What is the exception filter in ASP.NET Core?
- What is a limitation of the Exception filter?
- What is the use of the Result Filter in ASP.NET Core?
- What are Authentication and Authorization?
- How can we configure built-in identity service for ASP.NET Core application?
- What is the difference between AddDefaultIdentity and AddIdentity?
- How can we override default configuration?
- How can we configure windows authentication for the ASP.NET Core application?
Unit Testing
- What Unit Testing frameworks can be used with ASP.NET Core?
- How can we write a unit test with the MSTest framework?
- Can we create an MSTest project using the command-line interface (CLI)?
- How can we verify the test in MSTest?
- How can we run the test?
- Can we write a data-driven test using MSTest?
- How can we write a unit test with xUnit framework?
- How can we verify the test in xUnit?
- Can we write a data-driven test using xUnit?
- How can we write a unit test with NUnit framework?
- How can we verify the test in NUnit?
- Can we write a data-driven test using NUnit?
- What is the use of setup attributes in the NUnit framework?
- How can we create a test for the controller that has service dependency?
- What is a Mock (or moq) object in a unit test?
Deployment
- What are the different techniques for hosting an ASP.NET Core application?
- What is Kestrel?
- How to use Kestrel in ASP.NET Core application?
- Can we bind TCP socket with the Kestrel server?
- What is the HTTP.sys server?
- What are the features are supported by the HTTP.sys server?
- How to host an application using HTTP.sys server?
- How can we host the ASP.NET Core application as a Windows service?
- What is ASP.NET Core Module?
References: Microsoft Docs – ASP.NET Core, Stack Overflow – ASP.Net Core Interview Questions
Conclusion
I hope you liked this article on the asp.net core mvc interview questions. I would like to have feedback from my blog readers. Your valuable feedback, question, or comments about this article are always welcome.
Leave a Reply