Asp.net MVC Interview Questions for Experienced - 1

Question: 1

What is Model View Controller (MVC)?

While developing an Enterprise application, it is logical to interweave data access, business logic, presentation logic and control together. However, for a large enterprise level application, interweaving makes code files more complex; therefore, it will be difficult to manage while implementing changes in future.

This results in the duplication of data access and business logic code in the application at various points. As a result, the implementation, testing, business logic and control logic as different components, which can easily be reused.

The solution to these problems comes in the form of a Model-View-Controller (MVC) design pattern, which separates data access, business logic and presentation logic andThe solution to these problems comes in the form of a Model-View-Controller (MVC) design pattern, which separates data access, business logic and presentation logic andThe solution to these problems comes in the form of a Model-View-Controller (MVC) design pattern, which separates data access, business logic and presentation logic and enables creation of a number of views accessing the same enterprise application model.

Question: 2

Explain the components of Asp.Net MVC Framework?

The following are the components of Asp.Net MVC framework:

Model in MVC Framework – The model in MVC Framework represents the data and the business logic of the application, and is not related to the presentation of the application. The model components focus on keeping track of the state of your application. A Model can be considered as the foundation of the MVC architecture. Its core is composed of business logic and data access code.

The View and Controller interact with the Model for performing any task. In the MVC architecture, the Model layer is self contained and functions independent of the View and Controller layers. Therefore, the core application code, which is based on the Model, can be used with multiple user interfaces.

View in MVC Framework – The View provides the UI for the Model. The user interacts with the application through a View. It represents the information based on the Model and allows the user to alter the data. Typically, this UI is created from the model data.

Controller in MVC Framework – Controllers are the components that handle all the Views associated to a Model and ultimately select a view to render that displays an UI. When the user interacts with the View and tries to update the Model, the Controller invokes methods to update the Model. The Controller controls the data flow and transformation between the Model and the view.

Question: 3

What is URL Routing in Asp.Net MVC?

Routing validates variables used in the URL definition according to a pattern mentioned in it and automatically passes them as parameter arguments to a Controller action after validation.

Question: 4

Asp.Net MVC Framework provides an alternative to the development while designing and developing a Web as well as Windows applications. (True/False)

False

Question: 5

In the MVC architecture, data (Model) and user interface (View) are separated from each other so that any change in the user interfaces does not affect the data in the database. (True/False)

True

Related Questions