In this article we will discuss ASP.NET MVC Interview Questions. We are focusing on Objective Questions that can be asked in an interview.
Since we are talking about MVC we should have some knowledge of MVC.
Objective Interview Questions on ASP.NET MVC
Question 1: What does MVC stand for>
Answer: Model-View-Controller.
Question 2: What are three main components or aspects of MVC?
Answer: Model-View-Controller
Question 3: Which namespace is used for ASP.NET MVC? Or which assembly is used to define the MVC framework?
Answer: System.Web.Mvc
Question 4: What is the default view engine in ASP.NET MVC?
Answer: Web Form(ASPX) and Razor View Engine.
Question 5: Can we remove the default View Engine?
Answer: Yes, by using the following code:
- protected void Application_Start()
- {
- ViewEngines.Engines.Clear();
- }
Question 6: Can we have a Custom View Engine?
Answer: Yes, by implementing the IViewEngine interface or by inheriting from the VirtualPathProviderViewEngine abstract class.
Question 7: Can we use a third-party View Engine?
Answer: Yes, ASP.NET MVC can have Spark, NHaml, NDjango, Hasic, Brail, Bellevue, Sharp Tiles, String Template, Wing Beats, SharpDOM and so on third-party View Engine.
Question 8: What are View Engines?
Answer: View Engines are responsible for rendering the HTML from your views to the browser.
Question 9: What is Razor Engine?
Answer: The Razor view engine is an advanced view engine from Microsoft, packaged with MVC 3. Razor uses an @ character instead of aspx's <% %> and Razor does not require you to explicitly close the code-block.
Question 10: What is scaffolding?
Answer: Quickly generating a basic outline of your software that you can then edit and customize.
Question 11: What is the name of Nuget scaffolding package for ASP.NET MVC3 scaffolding?
Answer: MvcScaffolding
Question 12: Can we share a view across multiple controllers?
Answer: Yes, it is possible to share a view across multiple controllers by putting a view into the shared folder.
Question 13: What is unit testing?
Answer: The testing of every smallest testable block of code in an automated manner. Automation makes things more accurate, faster and reusable.
Question 14: Is unit testing of MVC application possible without running the controller?
Answer: Yes, by the preceding definition.
Question 15: Can you change the action method name?
Answer: Yes, we can change the action method name using the ActionName attribute. Now the action method will be called by the name defined by the ActionName attribute.
- [ActionName("DoAction")]
- public ActionResult DoSomething()
- {
- /TODO:
- return View();
- }
Question 16: How to prevent a controller method from being accessed by an URL?
Answer: By making the method private or protected but sometimes we need to keep this method public. This is where the NonAction attribute is relevant.
Question 17: What are the features of MVC5?
Answer:
- Scaffolding
- ASP.NET Identity
- One ASP.NET
- Bootstrap
- Attribute Routing
- Filter Overrides
Question 18: What are the various types of filters in an ASP.NET MVC application?
Answer:
- Authorization filters
- Action filters
- Result filters
- Exception filters
Question 19: If there is no match in the route table for the incoming request's URL, which error will result?
Answer: 404 HTTP status code
Question 20: How to enable Attribute Routing?
Answer: By adding a Routes.MapMvcAttributeRoutes() method to the RegisterRoutes() method of the RouteConfig.cs file.
I think 20 questions are enough for one day.
Your comments and suggestions are always welcomed.

Mohd Zubair KhanPosted Dec 19, 2018, 8:01 AM
Wow, nice article
Archana RathodPosted Jul 29, 2017, 5:19 AM
Very nice and useful article
dilip kumarPosted Feb 24, 2017, 5:58 PM
Hello manju great article yaar love u thanks
Munesh SharmaPosted Jun 20, 2016, 2:12 PM
nice
Amit Kumar SinghPosted May 10, 2016, 8:13 AM
Good one
Mandar DeshpandePosted Mar 10, 2016, 9:06 AM
Nice collection
Pramod GuptaPosted Nov 3, 2015, 2:36 AM
nice
Sumesh SGPosted Oct 4, 2015, 1:27 AM
http://grandhah.blogspot.in/2015/08/mvc-interview-questions.html
Sumesh SGPosted Oct 4, 2015, 1:27 AM
hi please fins the below link
sreerejith sreerejithPosted Oct 1, 2015, 11:45 AM
Nice Work check out http://grandhah.blogspot.in/2015/08/mvc-interview-questions.html
Rupesh BhavsarPosted Sep 4, 2015, 3:00 AM
Nice one
gaurav chamoliPosted Aug 25, 2015, 10:59 AM
good one :)
Prathamesh PurandarePosted Aug 6, 2015, 12:13 AM
Nice Article to kick off !!!
Lalit RaghavPosted Aug 4, 2015, 11:12 PM
nice article
Rajesh UpadhyayPosted Feb 22, 2015, 2:10 AM
Can you please add more questions ?
Jagan MohanPosted Feb 18, 2015, 12:58 AM
http://mvc3-jagan.blogspot.in/2014/01/aspnet-mvc3-important-interview.html
Jagan MohanPosted Feb 18, 2015, 12:56 AM
Regarding Briefly Please go for It :)
Saravanakumar SekaranPosted Dec 26, 2014, 8:42 AM
so nice
KIRUPA SUBRAMANIANPosted Oct 29, 2014, 7:15 AM
Regarding the Question 18: Authentication filter also available
KIRUPA SUBRAMANIANPosted Oct 29, 2014, 7:13 AM
@Manju...... From which source, you learned the ASP.NET MVC from basic
Guest UserPosted Oct 29, 2014, 6:24 AM
there is some difference between two, so you can do contrast/comparison also between these two.
Guest UserPosted Oct 29, 2014, 6:24 AM
sure...one is MVC pipeline & another WebAPI pipeline...
Guest UserPosted Oct 29, 2014, 5:42 AM
it would be awesome!
Guest UserPosted Oct 29, 2014, 5:42 AM
I would say if you can write article on MVC pipeline, i.e., how requests flows in MVC
Guest UserPosted Oct 29, 2014, 5:41 AM
good compilation Manju!
Rajeev RanjanPosted Oct 29, 2014, 3:10 AM
Simply awsm .
Chandradev PrasadPosted Oct 29, 2014, 2:51 AM
Nice collection.