天天看點

ASP.NET MVC Interview Questions with Answers

​​ASP.NET MVC Interview Questions with Answers​​

The whole purpose of this article is to quickly brush up your MVC knowledge from ASP.NET MVC interview perspective.

The purpose of this article is to quickly brush up your MVC knowledge before you go for MVC interviews. This article does not teach Asp.net MVC step by step, it’s a last minute revision sheet before going for MVC interviews. Things like: What is MVC (Model View Controller)? What are the benefits of using MVC? How can we do validations in MVC?

​​Download 100 MVC Interview questions with answers Ebook - 771.8 KB​​

​​Disclaimer​​

​​What is MVC (Model view controller)?​​

​​Explain MVC application life cycle?​​

​​Is MVC suitable for both Windows and web applications?​​

​​What are the benefits of using MVC?​​

​​Is MVC different from a three layered architecture?​​

​​What is the latest version of MVC?​​

​​What is the difference between each version of MVC 2, 3 , 4, 5 and 6?​​

​​What are HTML helpers in MVC?​​

​​What is the difference between “HTML.TextBox” vs “HTML.TextBoxFor”?​​

​​What is routing in MVC?​​

​​Where is the route mapping code written?​​

​​Can we map multiple URLs to the same action?​​

​​Explain attribute based routing in MVC?​​

​​What is the advantage of defining route structures in the code?​​

​​How can we navigate from one view to other view using a hyperlink?​​

​​How can we restrict MVC actions to be invoked only by GET or POST?​​

​​How can we maintain sessions in MVC?​​

​​What is the difference between tempdata, viewdata, and viewbag?​​

​​What is difference between TempData and ViewData ?​​

​​Does “TempData” preserve data in the next request also?​​

​​What is the use of Keep and Peek in “TempData”?​​

​​What are partial views in MVC?​​

​​How do you create a partial view and consume it?​​

​​How can we do validations in MVC?​​

​​Can we display all errors in one go?​​

​​How can we enable data annotation validation on the client side?​​

​​What is Razor in MVC?​​

​​Why Razor when we already have ASPX?​​

​​So which is a better fit, Razor or ASPX?​​

​​How can you do authentication and authorization in MVC?​​

​​How to implement Windows authentication for MVC?​​

​​How do you implement Forms authentication in MVC?​​

​​How to implement AJAX in MVC​​

​​What kind of events can be tracked in AJAX?​​

​​What is the difference between ActionResult and ViewResult?​​

​​What are the different types of results in MVC?​​

​​What are ActionFilters in MVC?​​

​​What are the different types of action filters?​​

​​If we have multiple filters, what’s the sequence for execution?​​

​​Can we create our own custom view engine using MVC?​​

​​How to send result back in JSON format in MVC​​

​​What is WebAPI?​​

​​But WCF SOAP also does the same thing, so how does WebAPI differ?​​

​​With WCF you can implement REST, so why WebAPI?​​

​​How can we detect that a MVC controller is called by POST or GET?​​

​​What is Bundling and Minification in MVC?​​

​​How does bundling increase performance?​​

​​How do we implement bundling in MVC?​​

​​How can you test bundling in debug mode?​​

​​Explain minification and how to implement it​​

​​How do we implement minification?​​

​​Explain Areas in MVC?​​

​​Explain the concept of View Model in MVC?​​

​​What kind of logic view model class will have?​​

​​How can we use two ( multiple) models with a single view?​​

​​Explain the need of display mode in MVC?​​

​​Explain MVC model binders?​​

​​Explain the concept of MVC Scaffolding?​​

​​What does scaffolding use internally to connect to database?​​

​​How can we do exception handling in MVC?​​

​​How can you handle multiple Submit buttons pointing to multiple actions in a single MVC view?​​

​​What is CSRF attack and how can we prevent the same in MVC?​​

For Further reading do watch the below Interview preparation videos  and step by step video series.

​​ASP.NET MVC Interview Questions & Answers​​

​​C# Interview Questions with Answers​​

​​Angular Interview Questions with Answers​​

​​Learn Azure step by step.​​

​​Learn MVC 5 Step by Step​​

​​MVC Core Step by Step Tutorial​​

​​SQL Server step by step​​

​​Session & Viewstate in ASP.NET.​​