- 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
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 III
Q 1 - You work for a financial services company that deals with many small brokers. Your executives want to be able to run a report that details all the actions taken by the brokers on the site as a form of auditing and protection. Neither the application nor system currently stores this kind of information. Which of the following are viable solutions? (Choose all that apply.)
D - Override the AuthorizeAttribute and have it store the user, the URL, and the forms collection.
Answer : E
Explanation
E.Creating a globally applied action filter enables you to save the state of every action taken by the user while logged in to your site.By creating a globally applied action filter you have ensured that every action taken by the user will be logged.
Q 2 - You are adding the capability for users to customize their site's display colors. You are required to provide a slider that enables users to change each RGB element. What can you do to ensure that this gets treated in the model and stored in the database as a single RGB color? (Choose all that apply.)
Answer : E
Explanation
E.This solution works because it combines the three discrete values into a single object on the model.Although it takes more work, using an approach of creating a model binder for the entire object, rather than just a part, successfully manages the need to have it in the model and in the database.
Q 3 - You are working on a AJAX-heavy site, and your script files are separated in your solution by function. You have already implemented minification and bundling, but you are still getting reports of poor performance when users try to access your pages. You cannot replicate the problem locally. What additional steps can you take and still provide the same user experience?
D - There is nothing more to do without redesigning the site.
Answer : C
Explanation
C.This is an appropriate next step to try to compress the script and style files being sent to the client.
Q 4 - You want to implement bundling and minification in your site. What are some of the potential problems you need to be aware of? (Choose all that apply.)
A - None; there is no condition in which this is a poor decision.
C - You should bundle and minimize scripts and CSS files together for maximum effectiveness.
D - Not bundling logically linked scripts together can have a negative effect on performance.
Answer : E
Explanation
E.Bundling every script into a single large file might decrease the effective- ness of concurrent downloading.Not separating scripts logically might lead to the user downloading scripts that will never be used. Although the download experience is maximized, it does not make sense to download unused scripts.
Q 5 - Your U.S.-based company recently opened an office in England. Staff members have been making lots of sales calls, which have generated an increase in visits to the company's websites. Much of the activity involves downloading sales sheets, product descriptions, and other sales support information currently stored in PDFs. There have been some performance-related complaints from remote sales staff, but no local users have noticed any problems. Which of the following are potential solutions? (Choose all that apply.)
A - Bundle and minify the PDF files to ensure that there is no wasted space.
D - Add two additional servers and create a server farm to serve your content.
Answer : E
Explanation
E.This solution causes more work on the client side to open and view the compressed content, but it provides a more responsive user experience.Moving the part of the site most affected by the new usage closer to the users increases their download speed and thus their perceived performance.
Q 6 - Your application has an intermittent issue, based on the user's path through the application, in which the application seems to stop running. Even when running in debug mode, the application calls a web service and then stops. The application locks and the call never returns, thus the user's request is never completed and eventually times out. What performance or profiling tool will provide the most pertinent information about your application?
A - CPU sampling in the Performance Wizard
B - Memory allocation in the Performance Wizard
Answer : C
Explanation
C.Thread and resource profiling will give some understanding of what kind of actions are taking place that will cause a resource or thread to be blocked
Q 7 - You inherited a working application that began as a proof of concept but was eventually adopted as a production application without being refactored. Many new requirements need to be added. As part of your initial analysis, you notice a lot of problems with bad data. Which solutions will help remediate this issue? (Choose all that apply.)
A - Running the Performance Wizard to sample CPU usage
B - Adding code contracts to ensure that the input parameters have expected values
C - Adding code contracts to ensure that the return values meet specific criteria
D - Adding code contracts to ensure that objects do not become invalid during process
E - Running the Visual Studio profiler to analyze application flow
Answer : F
Explanation
F.Preconditional code contracts ensure that incorrect information is not submitted to a method. This helps eliminate the possibility of bad data.Postconditional code contracts ensure that incorrect information is not returned from a method. This helps eliminate the possibility of bad data.Invariant code contracts ensure that objects do not get to an invalid state. This helps eliminate the possibility of bad data.
Q 8 - You are helping a client estimate the effort involved in adding comprehensive monitoring to an enterprise-level ASP.NET MVC application. Which of the following are useful considerations while building the estimate? (Choose all that apply.)
Answer : E
Explanation
E.Adding health monitors is an easy task. Determining which options pro- vide the information you need will be time-consuming because of the number of choices.Generic logging is a useful addition and can be added as items are refac- tored; it is not an all-or-nothing type of work.
Q 9 - You are re-creating an application that was originally built with ASP 2.0. You need to break the monolithic application into a traditional three-tier application. One of the requirements is that database errors must be displayed in the UI. Which solution will present enough information to the user so they can notify the appropriate person of a problem, but not allow the user to gain information about the design of the database?
A - Add a first chance exception handler and log the information in the error.
Answer : B
Explanation
B.The business layer is the appropriate place to manage data layer excep- tions. By repackaging it and sending it up to the user layer, you can maintain separation of concerns and meet the requirement to display information to the user. This will also enable you to log the information as necessary to support de- bugging.
Q 10 - What is an advantage to using first chance exception notification?
A - The ability to capture and handle all exceptions that occur within the application in one place
B - The ability to log an exception after it is handled by its appropriate error handling code
C - The ability to log an exception before it is touched by any other error handler
Answer : C
Explanation
C.The first chance exception handler enables you to examine an exception and take some action before it is touched by any other handler
Q 11 - Using custom error pages provides a lot of flexibility to an application because it allows for a consistent user experience even when the application has a problem. To take full advantage of this flexibility, you need to be able to create the pages and configure the application to use these pages. What code will provide custom error pages for 404 errors and general exceptions?
Answer : B
Explanation
B.This example shows the 404 error status and it sets the default error han- dler to the server error action
Q 12 - You are under contract with a large company that is starting to implement a TDD approach. As part of the long-term support for this effort, the company needs you to complete several unit tests. As you review the current code base, you find good tests for the model, but no tests for anything other than the model. Which of the following is the best approach to complete the unit tests?
Answer : D
Explanation
D.This solution provides for testing actions and nonactions as well as a good split of the tests per file.
Q 13 - Your ASP.NET MVC web application has just been released to a group of pilot users. The users are reporting periods of extreme performance degradation. You did not encounter performance issues during development or the quality assurance phase. What can you do in your development environment to understand what is occurring in the production environment?
Answer : C
Explanation
C. Starting from a midlevel count of users and then increasing to the total number of possible numbers should give you an idea of what is happening during the day-to-day running of the application in production
Q 14 - You support hardware purchasing for an ASP.NET MVC application in your company. The application is finished, and the development team knows the number of intended users. Which approach will give the team the best understanding of the application's hardware needs?
Answer : C
Explanation
C.This approach will give them an objective analysis of the amount of users a server can manage at a particular level of memory or CPU usage
Q 15 - You will be deploying your application in Windows Azure. You know that you need to include logging, but you have some concerns. What diagnostic capabilities can Windows Azure support? (Choose all that apply.)
C - The capability to retain logs from your custom logging solution when written to a local store
Answer : E
Explanation
E.You can control the diagnostics setting through configuration within your Windows Azure–hosted application.Although the Windows Azure VMs get recycled when the role restarts, saving the logs to the Windows Azure storage system outside of your VM would ensure that they are available.You can treat the Windows Azure diagnostics system like a traditional logging tool by writing messages to the system.
Q 16 - What do you need to do to use IntelliTrace from within Windows Azure? (Choose all that apply.)
A - Publish the solution from any version of Visual Studio Professional 2012 or higher.
B - Select the Enable IntelliTrace check box before publishing the solution.
D - Download and view the IntelliTrace logs through a web browser.
E - Download and view the IntelliTrace logs through Visual Studio Ultimate 2012.
Answer : F
Explanation
F.When publishing the projects, you can configure the process to deploy in debug mode with IntelliTrace enabled.You can view the IntelliTrace logs through Visual Studio after download.
Q 17 - You want to configure Windows Azure diagnostics. Where do you configure the specific Performance Monitors you want to have run in support of your application?
Answer : C
Explanation
C.You configure specific monitors that will run in your application in the Diagnostics.wadcfg file.
Q 18 - What type of authentication accepts login credentials that will be checked against the domain or local server and are sent in a hashed format?
Answer : B
Explanation
B.Digest authentication is a challenge-response–based authentication method to ensure that user credentials are not sent over the network in clear text.
Q 19 - Forms authentication enables you to write code to validate user credentials. After it is complete, you can register the authentication cookies for use throughout the user's visit by using which of the following?
A - FormsAuthentication.SetAuthCookie
B - FormsAuthenticationCookie = new FormsAuthenicationCookie();
Answer : A
Explanation
A.FormsAuthentication.SetAuthCookie registers the authentication token in the cookie for use in future requests
Q 20 - What default attributes or inline checks would you use to create an accepted-list scenario in ASP.NET MVC 4? (Choose all that apply.)
Answer : E
Explanation
E.AuthorizeAttribute can be put on controllers and actions to require au- thorization.AllowAnonymous can be put on controllers and actions to enable unau- thorized users access.
Q 21 - What interfaces or classes should be implemented or inherited when creating custom authentication that is based on a non-Windows, third-party provider? (Choose all that apply.)
Answer : E
Explanation
E.IIdentity describes the user that was authenticated.IPrincipal provides the security context of the user on whose behalf the code is running.
Q 22 - What kind of helper methods does WebSecurity provide? (Choose all that apply.)
Answer : F
Explanation
F.Login is one of the methods provided by the WebSecurity helper.ResetPassword is one of the methods provided by the WebSecurity helper.CreateAccount is one of the methods provided by the WebSecurity helper.ChangePassword is one of the methods provided by the WebSecurity helper.
Q 23 - What attribute or code snippet within a controller enables a role named Admin to access actions or code blocks after the check-in code?
A - RoleProvider.GetRolesForUser("Admin")
B - [Authorize(Roles="Admin")]
C - RoleProvider.IsUserInRole(User.Name)
Answer : B
Explanation
B.The Authorize attribute handles authorization on a controller and/or action basis by using the Roles= qualifier
Q 24 - Which methods help the RoleProvider determine whether a user is assigned a role or set of roles? (Choose all that apply.)
Answer : E
Explanation
E.GetRolesForUser gets a list of roles for a user.IsUserInRole returns a Boolean on whether a particular user has a role
Q 25 - Why should you create a custom role provider? (Choose all that apply.)
A - To use a data source not regularly supported
B - To use the SimpleRoleProvider
C - To use a database design different than .NET provides
Answer : E
Explanation
E.Because traditional providers work only on SQL Server, accessing a differ- ent data provider such as MySQL would require a custom provider.Using a different database design would require that you create a custom provider.
Answer Sheet
Question Number | Answer Key |
---|---|
1 | E |
2 | E |
3 | C |
4 | E |
5 | E |
6 | C |
7 | F |
8 | E |
9 | B |
10 | C |
11 | B |
12 | D |
13 | C |
14 | C |
15 | E |
16 | F |
17 | C |
18 | B |
19 | A |
20 | E |
21 | E |
22 | F |
23 | B |
24 | E |
25 | E |
To Continue Learning Please Login
Login with Google