MVC Framework Online Quiz



Following quiz provides Multiple Choice Questions (MCQs) related to MVC Framework. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.

Questions and Answers

Q 1 - 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.

Q 2 - 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.

Q 3 - You are creating an ASP.NET MVC web application. Within the application, you have created a partial view for contact email and phone number. Which code segment should you use to display the partial view on the main page?

A - @Html.ActionLink("ContactPartial")

B - @Html.Partial("ContactPartial")

C - @RenderPage("ContactPartial")

D - @RenderBody()

E - C and A both

F - All of the above

Answer : B

Explanation

B.@Html.Partial loads a partial view.

Answer : B

Explanation

B.Adding a DisplayModeProvider for each type of special view, such as IEMobile or IPad, informs the framework to use those views where the context condition is fulfilled.

Q 5 - You are globalizing an application and are compiling a list of items that need to be translated. Which items should be included on the list? (Choose all that apply.)

A - Images that are used as part of the menu structure

B - The company logo

C - Server error-logging messages

D - Button tooltips

E - A and D both

F - All of the above

Answer : E

Explanation

E. Images that are being used for menus likely have text displayed on them. That text should be localized, and extra sets of buttons might have to be created.Tooltips are supposed to give extra contextual help about the item the mouse hovers over. It is important to get them translated.

Q 6 - 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.

Q 8 - 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

Q 9 - You create an ASP.NET MVC 2 Web application that contains the following controller class.public class CartController : Controller { static List products = new List(); public ActionResult Index() { return View(); }}and the Views folder of your application, you add a view page named Index.aspx that includes the following @ Page directive.<%@ Page Inherits="System.Web.Mvc.ViewPage" %> You test the application with a browser. You receive the following error message when the Index method is invoked: "The view 'Index' or its master was not found." You need to resolve the error so that the new view is displayed when the Index method is invoked.What should you do?

A - Create a folder named Cart inside the Views folder.Move Index.aspx to the Cart folder.

B - Modify the Index method by changing its signature to the following: public ActionResult Index(Cart c)

C - Change the name of Index.aspx file to Cart.aspx

D - None of above

E - A and D both

F - All of the above

Answer : A

Explanation

A.Create a folder named Cart inside the Views folder.Move Index.aspx to the Cart folder.

Q 10 - Which Helper Method Returns binary output to write to the response?

A - Content

B - File

C - JavaScript

D - Json

E - C and D both

F - All of the above

Answer : B

Explanation

B.File Helper Method Returns binary output to write to the response

mvc_framework_questions_answers.htm
Advertisements