Interview Questions.

MVC Interview Question and Answers


MVC Interview Question and Answers

Q1. Explain what's Model-View-Controller?

Ans: MVC is a software program structure pattern for growing web application. It is dealt with via 3 items Model-View-Controller.

Q2. Mention what does Model-View-Controller constitute in an MVC application?

Ans: In an MVC version;

Model: It represents the software records domain. In other phrases packages enterprise good judgment is contained in the version and is answerable for retaining information.

View: It represents the person interface, with which the quit customers communicates. In brief all of the consumer interface good judgment is contained within the VIEW.

Controller: It is the controller that answers to consumer actions. Based on the user moves, the respective controller responds within the version and pick a view to render that display the person interface.  The user input logic is contained with-in the controller.

Q3. Explain in which assembly is the MVC framework is defined?

Ans: The MVC framework is defined in System.Web.Mvc.

Q4. List out few one of a kind go back kinds of a controller motion approach?


View Result

Javascript Result

Redirect Result

Json Result

Content Result

Q5. Mention what's the difference among adding routes, to a webform application and an MVC application?

Ans: To add routes to a webform utility, we can use MapPageRoute() technique of the RouteCollection class, in which including routes to an MVC software, you may use MapRoute() technique.

Q6. Mention what are the two methods to add constraints to a path?

Ans: The two methods to feature constraints to a course is:

Use normal expressions.

Use an object that implements IRouteConstraint Interface.

Q7. Mention what's the advantages of MVC?


MVC segregates your assignment right into a extraordinary section, and it becomes clean for developers to work on

It is easy to edit or exchange a few a part of your challenge that makes challenge much less development and protection fee

MVC makes your mission more systematic

Q8. Mention what “beforFilter()”,“beforeRender” and “afterFilter” functions do in Controller?


beforeFilter(): This characteristic is run earlier than each motion inside the controller. It’s the proper vicinity to test for an active session or check out person permissions.

BeforeRender(): This function is called after controller movement good judgment, but earlier than the view is rendered. This feature isn't regularly used, however may be required If you are calling render() manually earlier than the cease of a given movement.

AfterFilter(): This feature is called after each controller motion, and after rendering is carried out. It is the final controller method to run.

Q9. Explain the function of components Presentation, Abstraction and Control in MVC?


Presentation: It is the visual representation of a particular abstraction in the application

Abstraction: It is the business domain capability within the software

Control: It is a component that continues consistency between the abstraction in the machine and their presentation to the user similarly to speaking with different controls in the machine

10) Mention the advantages and disadvantages of MVC model?


Advantages    Disadvantages

It represents clear separation between business logic and presentation logic

Each MVC item has different duties

The improvement progresses in parallel

Easy to manipulate and keep

All lessons and object are unbiased of every other

The version pattern is little complex

Inefficiency of facts access in view

With modern person interface, it is hard to apply MVC

You want a couple of programmers for parallel development

Multiple technologies know-how is needed