MVC Framework Mock Test


Advertisements


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.

Questions and Answers

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?

A - Design a model that handles the data call to populate the model. Create a partial view containing only this display area and put an asynchronous service call that returns this model in the partial view controller.

B - Put a synchronous service call into the main page controller.

C - Create a partial view containing only this display area and put a synchronous service call in the partial view controller.

D - Create a partial view containing only this display area and put an asynchronous service call in the partial view controller.

E - A and D both

F - All of the above

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.

B - Create an individual model for each of the data requests, and then create a view- specific model that calls those models and merges the data.

C - Create a model for the summary data and handle the various data requests within that model as well as the merging of the data.

D - Create an individual model for each of the data requests and then merge the data on the client side for display.

E - C and D both

F - All of the above

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.

B - Use Code First.

C - Use Model First or Use Database First.

D - None of the Above

E - B and D both

F - All of the above

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?

A - It won't; the requirements state that the application should talk directly to the HR systems' database.

B - You should ensure your naming convention for the database as clearly as possible so you can rework your data calls with minimal changes.

C - You should implement the Repository pattern with the current HR system being the first repository that is built. When the second system comes online, you implement that data access using the same pattern.

D - You should map the model directly to the database calls, anticipating that you will have to change the model as the new system rolls out.

E - B and D both

F - All of the above

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.)

A - Task an individual on staff to learn WCF, and have this individual develops and deploys these new services using WCF.

B - Use the Web API to create REST services using ApiController in which the serialization type is defined by the Accepts property of the browser.

C - Build a basic ASP.NET MVC 4 project in which the view simply passes through the information provided by the controller, and the controller manages the code for serializing the response.

D - Create an ASP.NET ASMX services file to get, serialize, and return the data.

E - B,C and D

F - All of the above

Answer : E

Explanation

E.Using ASP.NET MVC is another way to create a controller that will return XML.

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 9 - AppCmd.exe is an application that helps you work with which objects? (Choose all that apply.)

A - Site

B - Users

C - Config

D - App

E - A, D and E

F - All of the above

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.

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.)

A - InProc

B - SQLServer

C - StateServer

D - Custom session provider

E - C and D both

F - All of the above

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.)

A - LocalStorage

B - QueryString

C - ViewState

D - Cookies

E - B and D both

F - All of the above

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.

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.)

A - Page output caching

B - Application caching

C - Data caching

D - HTTP caching

E - B and D both

F - All of the above

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.)

A - Data caching

B - Donut hole caching

C - Donut caching

D - Windows AppFabric caching

E - B and C both

F - All of the above

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.)

A - Data caching

B - Page output caching with duration of two minutes

C - Page output caching with duration of four hours

D - Windows AppFabric caching

E - A, C and D

F - All of the above

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?

A - HTTP polling

B - HTTP long polling

C - WebSockets

D - HTTP request-response

E - C and D both

F - All of the above

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.)

A - WebSockets

B - HTTP polling with 1-minute intervals

C - HTTP long polling

D - HTTP polling with 15-minute intervals

E - A and D both

F - All of the above

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.

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

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?

A - object, EventArgs

B - HttpApplication

C - HttpContext

D - Object

E - A and D both

F - All of the above

Answer : C

Explanation

C.The ProcessRequest method takes the HttpContext parameter.

Answer : C

Explanation

C.Intercepting every request for .jpg and .png files is the easiest way to consistently add watermarks to the images.

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.

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.

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

mvc_framework_questions_answers.htm

Advertisements
E-Books Store