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.

Questions and Answers

MVC Framework Mock Test III

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.

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?

A - Compress all scripts locally and have the users download the compressed files rather than the uncompressed files.

B - Turn IIS compression on, turn on the option to compress dynamic pages, and set the minimum file size to 0 so that every file served will be compressed.

C - Turn IIS compression on, disable dynamic page compression, and set the minimum file size to the size of your smallest bundled script file.

D - There is nothing more to do without redesigning the site.

E - A and C both

F - All of the above

Answer : C

Explanation

C.This is an appropriate next step to try to compress the script and style files being sent to the client.

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.

B - Write an action result that takes a file name and returns a compressed version of the file for download.

C - Sign on with a CDN with nodes in North America and Europe and use it to serve files and other static content to sales support staff.

D - Add two additional servers and create a server farm to serve your content.

E - B and C both

F - All of the above

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

C - Resource contention data in the Performance Wizard

D - Tracing from the System.Diagnostics namespace that logs the times of web service call and web service return

E - The Health Monitoring tool, for capturing security information related to the interaction with the web service

F - A and D both

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

F - B, C and D

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.

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.

B - Add a generic database-layer exception handler to the business layer, and pass appropriate error information to the UI layer for display in a custom error page.

C - Add specific database exception handlers in the business layer and log the information into the database for further review.

D - Let the errors pass through the business layer to the UI layer where they can be handled as specific errors and presented as appropriate in the UI.

E - A and D both

F - All of the above

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.

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

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

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.

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?

A - ServiceDefinition.csdef

B - ServiceConfiguration.cscfg

C - Diagnostics.wadcfg

D - Web.config

E - A and B both

F - All of the above

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?

A - Basic authentication

B - Digest authentication

C - Forms authentication

D - Windows authentication

E - A and B both

F - All of the above

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();

C - FormsAuthentication.ClearAuthCookie

D - MembershipProvider.User =

E - A and B both

F - All of the above

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

A - Authorize attribute

B - RequireHttps attribute

C - WebSecurity.IsAuthenticated

D - AllowAnonymous attribute

E - A and D both

F - All of the above

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

A - ActiveDirectoryMembershipProvider

B - IIdentity

C - SqlMembershipProvider

D - Iprincipal

E - B and D both

F - All of the above

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

A - Login

B - ResetPassword

C - CreateAccount

D - ChangePassword

E - DeleteAccount

F - A ,B , C and D

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)

D - [AuthorizeAttribute(Roles="Admin")]

E - A and B both

F - All of the above

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

A - GetRoles

B - GetRolesForUser

C - IsUserInRole

D - FindUsersInRole

E - B and C both

F - All of the above

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

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
mvc_framework_questions_answers.htm
Advertisements