1. Back To Blog

ASP.NET MVC written test Interview question

Below is a MVC written test Interview question paper which was given to senior people to do pre-evaluation.


If you are supposed to do validation in MVC what the best approach?


  • Write the validation in the models.
  • Use data annotations like [required] validator.


You want to implement Ajax in MVC, what will you do?


  • XML HTTP Request
  • Use JSON and JQUERY calls
  • Update panel


You want to create SEO friendly URL's in MVC?


  • Routing
  • Create custom HTTP handlers and use VERB


Which of the below statements are false?


  • Viewdata helps to pass data from controller to view.
  • Tempdata helps to pass data from controller to controller.
  • Viewdata helps to pass data from view to controller.


If you want to bind two models with a view?


  • Not possible with MVC
  • Use ViewModel


You want to emit out JSON from MVC?


  • Serialize the object and pass it back
  • Use JSONResult
  • Use WCF and emit out JSON


How is the hierarchy in Angular?


  • Controller -> App -> Model
  • App ->Controller-> Model


You want to compress your JavaScript files in MVC?


  • Use Winrar
  • Use Bundling and minification


You want to make cross domain JSON calls :-


  • Enable cross domain in web.config file of JSON project.
  • Use [CrossDomain] attribute.
  • CORS does not work by design


What is the use of filters ?


  • Filters and queries SQL
  • Does preprocessing and post processing logic


Can we do pessimistic locking in EF ?


  • Yes
  • No


You want to render MVC ASCX ?


  • Use RenderAction
  • Use RenderPartial


Is it possible to create a custom view engine like Razor ?


  • No
  • Yes


How to enable Lazy loading in EF ?


  • Use include
  • Use stored procedures.
  • None of the above , it enabled by default.


What is false about WebAPI ?


  • It does content negotiation.
  • Emits out JSON and XML
  • Emits out WCF SOAP


You have heavy Action which is taking lot of time ?


  • Create that site on a different app pool.
  • Use Delegates
  • Use Async controllers.


In case you are fresher to MVC start from the below video


Shiv Prasad Koirala

Visit us @ www.questpond.com or call us at 022-66752917... read more

We are on Social