Interview patterns - technical interview questions logo
 

ASP.NET MVC Interview questions

by Alex 14. December 2009 11:29

As I already posted, my wife is now in the process of searching for the new opportunity, so I am stilling her interviewing experience and new questions. Surprisingly people already asking about MVC experience and even hands-on knowledge questions ! All questions were quite basic and didn’t required deep understanding of ASP.NET MVC and rather were testing general knowledge of platform.

ASP.NET MVC Interview questions  

Question #1. What is MVC pattern?

Model-View-Controller (MVC) is a classic design pattern often used by applications that need the ability to maintain multiple views of the same data. The MVC pattern hinges on a clean separation of objects into one of three categories — models for maintaining data, views for displaying all or a portion of the data, and controllers for handling events that affect the model or view(s). Wikipedia article.

Question #2. What is ASP.NET MVC?

ASP.NET MVC is a free, fully supported, Microsoft product that enables developers to easily build great web applications. It provides total control over your HTML and URLs, enables rich AJAX integration, and facilitates test driven development.

Question #3. What are the advantages of ASP.NET MVC?

According to http://www.asp.net/  ASP.NET MVC provides the following benefits:

• Provides complete control over your HTML markup
• Enables rich AJAX integration
• Intuitive website URLs
• Clear separation of concerns which results in web applications that are easier to maintain and extend over time.
• Testability – including support for test-driven development.

Question #4. What is difference between MVC and MVP patterns?

MVC  -  Model View Controller
MVP  - Model View Presenter
The main difference between the two is how the manager (controller or presenter) behaves in the overall architecture. In MVC - controller is driver for the application who manages and controls the requests. In MVP View is the main driver and the first object instantiated in the execution pipeline. More >>

Question #5. Where would you put the validation logic for your MVC application?

In Model classes.

Question #6. What namespace you need to include to use ASP.NET MVC?

System.Web.Mvc

Question #7. What is edmx file?

Actually it is loosely related to MVC. An .edmx file is an XML file that defines an Entity Data Model (EDM), describes the target database schema, and defines the mapping between the EDM and the database. One can use EDM as the Model in MVC applications. More here...

Question #8. What are the main ASP.Net MVC action results and their uses? Which one have you used?

ContentResult
EmptyResult
FileResult 
FileContentResult 
FilePathResult   
FileStreamResult
HttpUnauthorizedResult
JavaScriptResult
JsonResult
RedirectResult
RedirectToRouteResult
ViewResultBase   
PartialViewResult  
ViewResult

Note, you can have any type as an action result, framework will call ToString() on your type and wrap it into ContentResult type.

Question #9. How would you pass data from Controller to View in MVC Application?

By using ViewData.More >>

Question #10.  How would you exclude ID and Name DB fields from binding to your object?

Exclude take comma separated list, so your attribute would look like following:
[Bind(Exclude="ID,Name")]


The good resources to read would be

APS.NET official website:  www.asp.net/mvc
Phil’s Haak website:
Haaked
Jim Zimmerman:  Introduction to ASP.NET MVC Screencast

Also, here Phil, one of the driving forces behind ASP.NET MVC, provides the lowdown on what is MVC :

 

Currently rated 4.0 by 4 people

  • Currently 4/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , ,

ASP.NET MVC


Comments




All material copyright © North Pacific Technology Group, LLC. All rights are reserved. No part of any material on this web site may be reproduced, or stored in a database or retrieval system, distributed, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written permission. Terms of use.

Powered by BlogEngine.NET 1.4.5.0

Job Search

what
job title, keywords
where
city, state, zip
jobs by job search