ASP.NET MVC Interview Questions and Answers Part 1

By
1.) What is MVC ?                                                                                                                             
  • MVC stands for Model-View-Controller.
  • MVC was introduced in 1970 . 
  • MVC is software design pattern.
  • It is more helpful for testing and maintaining the applications.
2.) How many layers are used in  MVC  framework?                                                         
There are basically three layers in mvc framework as given below.
  • Presentation logic
  • Business Logic
  • Control Logic 
3.) What was the main reason to develop  MVC template ?                                           
There was some reason to develop mvc template as given below:-
Nowadays, There are lots of peoples accessing the information from the web.They are accessing the information from different sources like  Laptop,Desktop,Mobile,Tablet,Ipad etc. So Developers should develop those applications who can be viewed on different devices easily. To overcome this problem Microsoft has developed a template that is called  MVC Template.
4.) What are the different type of interfaces used to access the information on the internet?
There are three types of interfaces, can be used to access the information from the internet as given below:-
1.) HTML View :- Many web users want to view web application in HTML format (static page). MVC framework provide this feature to our web users.  
2.) WML View :- Nowadays, most of the user accessing information through mobile ,laptop,tablet etc.on wireless network.MVC framework provide this compatibility to our wireless users. 
3.) Form View :- This features can be used only by Administrator .MVC Framework is also helpful for this purpose.
see it,,.
5.) What are the three components used in Mvc application ?                                      
  • Model 
  • View
  • Controller
6.) What is mvc design pattern ?                                                                                               
MVC design pattern divides an application into three aspects:-
  • model
  • view
  • controller
Model :-This component represents the data and the business logic of the application.The model in the MVC framework is not related to the presentation of the application.The model component focus on keeping track of the state of the application.It also defines business rules for data, means how the data can be changed and manipulated.
View :-The view provides the user interface (UI) for the model. The main work (function) of the view is represent the information in user understandable format. It uses UI Components such as HTML,CSS,Jquery etc.
Controller :- Controller act as a mediator between view and model. it is responsible to control the data transmission between the model and the view . It maps the user action into  model updates.The controller layer is helpful to selects the most appropriate view and delivers it to the user.

7.) What are the features of Model in MVC Framework ?                                               
There are some features of model in mvc framework as given below:-
  • This component represents the data and the business logic of the application.The model in the MVC framework is not related to the presentation of the application.
  • The model component focus on keeping track of the state of the application.
  • This component (model) is not exposed to the information about the view and the manner (way) in which data is to be displayed.
  • A model does not know about view actions used to manipulate the data.
  • Every data is accessed and manipulated through the methods that are completely independent of the view.
  • A model is contains the business logic and data access code .This is the main component of the MVC framework.
  • A model defines what the application exactly does.
  • The model layer is self contained and function independent of the view and the controller layers. 
  • For performing any task , the view and controller interact with model.
Example :-
Suppose,we want to calculate the area of the rectangle.then the computational part will be performed in the model layer. 
8.) What are the features of View in MVC Framework ?                                                 
There are some features of View in mvc framework as given below:-
  • Rendering the content of the model :- The main work (function) of the view is represent the information in user understandable format.With the help of view user can perform input output operations.
  • Requesting the updates from the model:- You already know ,the data access and business layer codes available on the model layer.So any changes in database or values in model layer to update the changes if any.
  • Sending the user inputs to the controller :- Suppose, if user want to modify the database value on the model layer,in such case user can't communicate with model layer directly .Here user first interact with view which further communicates with controller about the user input,after that controller makes changes in model layer according to user requirements and then after it inform the changes to view layer.
  • Allowing the controller to select the view:- Different users might have different views.Views allows the controller to determine which view is suitable for which user and provide them accordingly.
9.) What are the features of View in MVC Framework ?                                                 
There are some features of View in mvc framework as given below:-
  •  Control the data transmission between model and view layer:-The controller control the data flow  and transformation between the model and the view layer in the application.
  • Mapping the user action into model updates:- The controller is used as mediator between view and model layer.If any users want to modify the database values through view ,here user can't communicate directly through view to model layer.   
  • Select appropriate view for response:- An application provides multiple views of an application.The controller layer is helpful to selects the most appropriate view and delivers it to the user.
10.) Is Model component aware about the view and the controller components  in MVC Framework ?
No, Model component doesn't  know about the  view and the controller components.It is independent the view and the controller components.
see it...
11.) Which two components can communicate directly with each other in MVC Framework ?
The view and the controller communicates with each other directly because these two components are specially designed to work together.
12.) Which is the more important component of MVC Framework  and why?       
The Model component is the important component in mvc framework because it contains business logic and data access codes.

0 comments:

Post a comment

Powered by Blogger.