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.
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.
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.
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.
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.
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.
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.
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.Using ASP.NET MVC is another way to create a controller that will return XML.
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.
D - Create a WCF proxy class.
E - B and C both.
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.
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?
A - The startup role consumes the error during its load; if there is no event handler configured, it is set to Handled as the task completes.
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.
B.The task will stop processing and return a non-zero value.
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.
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.
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.
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.
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.
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.
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.
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?
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.
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?
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.
B - No, after the request starts into the process, it either continues through to the mapped handler or throws an error.
C - Yes and you handle the MapRequestHandler event.
D - Yes and you handle the ReleaseRequestState event.
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?
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?
C.Intercepting every request for .jpg and .png files is the easiest way to consistently add watermarks to the images.
A - Your application has a requirement to display a menu section that changes based on the area of the application the user is visiting.
B - Each content area on your page needs a header that displays the company's branded color and contains the first 40 characters of the content area's content followed by an ellipsis.
C - You have created a set of styles, each in a different style sheet. The styles need to be available to every page in the application.
D - Your application has three different default page designs: two rows of information, two columns of information, and three columns of information.
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.
D - Use inline styling.
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.
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.