- MVC Framework Tutorial
- MVC Framework - Home
- MVC Framework - Introduction
- MVC Framework - Architecture
- MVC Framework - ASP.NET Forms
- MVC Framework - First Application
- MVC Framework - Folders
- MVC Framework - Models
- MVC Framework - Controllers
- MVC Framework - Views
- MVC Framework - Layouts
- MVC Framework - Routing Engine
- MVC Framework - Action Filters
- Advanced Example
- MVC Framework - Ajax Support
- MVC Framework - Bundling
- Exception Handling
- MVC Framework Useful Resources
- Questions & Answers
- MVC Framework - Quick Guide
- MVC Framework - Resources
- MVC Framework - Discussion
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
MVC Framework Mock Test
This section presents you various set of Mock Tests related to MVC Framework Framework. You can download these sample mock tests at your local machine and solve offline at your convenience. Every mock test is supplied with a mock test key to let you verify the final score and grade yourself.
MVC Framework Mock Test I
Q 1 - You are designing an application in which a section of the main page will be populated by content from a third-party provider. You do not have control over the responsiveness of the client or how much information will be returned with each request. The call is to a Restful service and will return the information formatted in Extensible Markup Language (XML). What is the best way to implement this application?
B - Put a synchronous service call into the main page controller.
Answer : A
Explanation
A.Because you do not have control over the responsiveness of the third- party provider and you do not know how much data might be returned from each call, you should wrap the call in the asynchronous framework. Providing the data in a strongly-typed model gives it more flexibility than working with the raw XML on the client side.
Q 2 - You have been given requirements for a dashboard page that will contain summary information from your order processing system in a single display table. However, this summarization needs to be done by combining data requests from the order system, the shipping system, and the accounting system. The dashboard page will be the only place you use this combined data. What is the best way to implement this requirement?
A - Make the various data requests and compile the information in the controller for display.
Answer : B
Explanation
B.You will have a better chance of code reuse if you break down the separate calls into their own models and then create another model to pull them together and compile them.
Q 3 - A significant change has been requested in an application maintained within your company. The application is a classic ASP application that uses custom Open Database Connectivity (ODBC) drivers to connect to a relational data repository on a mainframe computer. The CIO decided that the company needs to replace this 30-year-old system. The team that worked on the original project is made up of developers who have never worked with an object-oriented approach before. Which approaches would be the best to use when designing your initial schema in Entity Framework? (Choose all that apply.)
A - Create your own custom design because it’s too much work to manage an inexperienced staff.
Answer : C
Explanation
C.The use of the Entity Designer as an integral component in the Model First approach will help unfamiliar users to walk through the process.The use of the Entity Designer as an integral component in the Model First approach will help unfamiliar users to walk through the process.
Q 4 - You are designing an application that allows employees to change their human resources (HR) information, such as next of kin and direct deposit information. The requirements state that the application should talk directly to the HR systems database. However, at a recent company meeting, the CFO announced that the company will be converting to a new HR system over the next two years. They will take an additional year to move employees to the new system, one department at a time. How will this affect your design?
Answer : C
Explanation
C.Using the Repository pattern will give you a level of abstraction into the data layer. When you create the second data access component for the new HR system, you can then differentiate on a user or departmental level which implementation to use.
Q 5 - You are developing an application. One requirement is that part of your data access layer needs to be available to a third party, that wants to get this information from a REST URL in XML. Your company does not have experience with web services, but you have several websites running ASP.NET MVC 4. How could you design and provide these new services? (Choose all that apply.)
D - Create an ASP.NET ASMX services file to get, serialize, and return the data.
Answer : E
Explanation
E.Using ASP.NET MVC is another way to create a controller that will return XML.
Q 6 - How could you traditionally consume an ASMX web service from your application? (Choose all that apply.)
A - Generate a proxy by selecting Add Reference in Visual Studio.
B - Create an HttpService and connect using Get (URL).
C - Generate a proxy by selecting Add a Service Reference in Visual Studio.
Answer : E
Explanation
E.HttpService.Get gets the output of a REST service.Visual Studio creates a proxy for you from the WSDL at the site you select.
Q 7 - What are examples of hybrid applications using Windows Azure? (Choose all that apply.)
Answer : E
Explanation
E.Part of the application is being run in the Windows Azure environment; the other part is being run in the corporate network environment.
Q 8 - What occurs if an unhandled error is fired on a startup task?
B - The startup is cancelled and the role does not start.
C - The OnStop method automatically runs.
D - The startup task goes to the lowest security setting and continues to run, if possible.
Answer : B
Explanation
B.The task will stop processing and return a non-zero value.
Q 9 - AppCmd.exe is an application that helps you work with which objects? (Choose all that apply.)
Answer : E
Explanation
E.AppCmd.exe enables the configuration of virtual sites.AppCmd.exe supports the administration of general configuration sections.AppCmd.exe manages the support of applications.
Q 10 - .Which of the following are valid reasons for overriding the Run method? (Choose all that apply.)
C - Managing error handling for the application
D - Starting and supporting a logging application for use by the Worker role
Answer : E
Explanation
E.Creating and running an application in parallel is what the Run method was designed to allow.The polling service is a good example of an activity in which the Run.method enables a process to work independently of the main role.Creating and running an application in parallel is what the Run method was designed to allow.
Q 11 - You are designing an ASP.NET MVC 4 application that uses an Oracle database for persistence. What session configuration choices enable you to deploy your application on a web farm? (Choose all that apply.)
Answer : E
Explanation
E.Using a shared state server across the web farm is an available option. Using a state server designates one server to maintain state for all the servers that connect to it.A custom session provider enables you to maintain state as necessary by doing the work in your custom code. It is generally used when you try to use a dif- ferent RDBMS system or when you do not want to use the default session database design.
Q 12 - You are creating an ASP.NET MVC 4 web application that will be accessed by a large number of traditional consumers. If you need to be able to access state information on the client side in JavaScript/jQuery, where can you store it? (Choose all that apply.)
Answer : E
Explanation
E.Query string information is available across all browsers and is usable on both the client and server.Cookies can be stored for a period of time on the client and be read from either client- or server-side operations.
Q 13 - As you design a session-less state management system, what do you need to ensure that your application manages? (Choose all that apply.)
C - The session setting within the Web.config file
D - An identifier used by the server to identify the request
Answer : E
Explanation
E.Your application needs to manage whatever information might be re- quired to access the state management system.Your application needs to manage the passing of the identifier between requests.
Q 14 - You are designing a work order management application for a mid-size repair company. The application will be used by repair personnel in the field on their laptops with wireless phone connections. The connections are slow, and the laptops are several years out of date. There will never be more than 15 users at any one time, and rarely more than 2 concurrent users. What kind of caching will give the repair personnel a better user experience? (Choose all that apply.)
Answer : E
Explanation
E.Page output caching will cache content at the client side to eliminate some of the required downloads. It is useful in a limited bandwidth environment. It can also be used in donut hole and donut caching scenarios for partial client-side caching.HTTP caching will help response time even though there is not much a developer needs to do to implement the caching.
Q 15 - You are creating a solution in which the majority of the application is dynamic, but some areas can be cached for a long time. What kind of approach would you take? (Choose all that apply.)
Answer : E
Explanation
E.Donut hole caching provides the ability to cache parts of each page.Donut caching is another approach that gives the ability to cache parts of the application.
Q 16 - You are adding a reporting vertical to an enterprise application. Many of the reports will be run every morning by a set of users. Some of the reports will be identical as every member of a team will get the same report sometime in the morning. What kind of caching will provide an improvement in performance? (Choose all that apply.)
B - Page output caching with duration of two minutes
Answer : E
Explanation
E.Data caching with the appropriate timeout will enable the data needed for the reports to be stored so that the call to the database is not necessary.A page output caching of four hours caches the output of the report for the whole morning and should eliminate the need for the report to be run a second time.AppFabric caching acts much like data caching to eliminate the need for additional calls to the database to generate the reports.
Q 17 - What is the technique in which the client sends a request to the server, and the server holds the response until it either times out or has information to send to the client is?
Answer : B
Explanation
B.In HTTP long polling, the client sends a request to the server, and the server holds it open until it either has something to return to the client or the con- nection times out.
Q 18 - You are building an application in which you want to display updated information to a website every 15 minutes. What are efficient ways to manage the update? (Choose all that apply.)
B - HTTP polling with 1-minute intervals
Answer : E
Explanation
E.WebSockets can be used to pass information between the client and server.HTTP polling with 15-minute intervals is a valid way to get the informa- tion within the required time frame.
Q 19 - What is the first request sent to start HTTP polling?
Answer : B
Explanation
B.The first request to open a WebSocket connection is a standard HTTP GET. After the request is received, the browser sends a separate upgrade request
Q 20 - In an HTTP module, can you redirect the request to a different handler than is in the routing table? If so, what event would you handle?
A - Yes and you handle the PostAuthorizeRequest event.
C - Yes and you handle the MapRequestHandler event.
Answer : C
Explanation
C.You handle the mapping of the request in the MapRequestHandler.
Q 21 - When you are creating a custom handler, what is the parameter being passed into the ProcessRequest method?
Answer : C
Explanation
C.The ProcessRequest method takes the HttpContext parameter.
Q 22 - What is the best way to intercept every request for an image on your site and ensure that a watermark is added to the image?
A - An HTTP module handling the AuthorizeRequest event
B - A custom HTTP handler set to handle .htm and .html pages
C - A custom HTTP handler configured to serve .png and .jpg files
D - An HTTP module handling the PostRequestHandlerExecute event
Answer : C
Explanation
C.Intercepting every request for .jpg and .png files is the easiest way to consistently add watermarks to the images.
Q 23 - Layout.cshtml and Site.Master are the two default template pages in ASP.NET MVC. Which of the following scenarios would best be solved using a single layout or master template? (Choose all that apply.)
Answer : E
Explanation
E.Adding logic to the master page to determine the menu design enables your application to display a menu section that changes based on the area of the application the user is visiting.Referencing all style pages in a single place, the layout page, is an appropriate use.
Q 24 - You are designing a web application. You want to create a certain look and feel while reusing styles across pages as much as possible. How should you handle styles?
A - Use only one or two styles throughout your application to simplify maintenance.
B - Use a specific (unique) style for every element.
C - Use general styles for common elements and specific styles for elements that are unique.
Answer : C
Explanation
C.You should use general styles as much as possible. Achieving a certain look and feel means that you might have to create some specific styles, however.
Q 25 - What are compelling reasons to switch from static web content to dynamic web content? (Choose all that apply.)
A - The ability to substitute a new image for the company logo
B - The ability to display information from a database
C - The ability to link to other pages outside of your application
D - The ability to display information pertaining to the current user
Answer : E
Explanation
E.Displaying data from a database is an ideal reason to use a dynamic website.Personalization, or displaying information about the user on-screen, is an example of dynamic content.
Answer Sheet
Question Number | Answer Key |
---|---|
1 | A |
2 | B |
3 | C |
4 | C |
5 | E |
6 | E |
7 | E |
8 | B |
9 | E |
10 | E |
11 | E |
12 | E |
13 | E |
14 | E |
15 | E |
16 | E |
17 | B |
18 | E |
19 | B |
20 | C |
21 | C |
22 | C |
23 | E |
24 | C |
25 | E |