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

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.

Q 4 - Your company has joined an industry accessibility group and you are a member. As one of your responsibilities, you have been asked to estimate the time it would take to modify your corporate site for accessibility. What should you consider to properly estimate the required time? (Choose all that apply.)

A - The amount of text in the website

B - The level of current usage of HTML helpers in your views

C - The numbers of controllers in the application

D - The complexity of your data entry forms

E - B and D both

F - All of the above

Answer : E

Explanation

E.Because ASP.NET MVC 3 HTML helpers are not ARIA compliant, you need to write custom HTML helpers or use a different process to create HTML forms.Because many of the problems with accessibility are related to giving context to content, complex forms need a thorough review to ensure that labels and section context are provided for every element on the page.

Q 5 - You are developing an ASP.NET MVC application. You have a set of requirements to create a help section for remote users. Your typical help scheme is help/desktop or help/mobile, so logically this section should be help/remote. The change board wants the links in the application to point to the default support site. Which code segment would you use?

A - routes.MapRoute(name: "Default",url: "{controller}/{action}/{id}", defaults: new { controller = "Home",action = "Index", id = UrlParameter.Optional });

B - routes.MapRoute( "remote", "help/remote",new { controller = "support", action = "Index" });

C - routes.MapRoute( "remote", "help",new { controller = "support", action = "Index" });

D - routes.MapRoute( "remote", "remote/help",new { controller = "support", action = "Index" });

E - C and C both

F - All of the above

Answer : B

Explanation

B.This is how you add an additional route and point to a different controller.

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 7 - 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 8 - WIF enables you to create a custom token. To be able to use the token, you must create a custom token handler by overriding which of the following?

A - SecurityToken

B - SecurityTokenHandler

C - SWTToken

D - Saml2SecurityTokenHandler

E - A and B both

F - All of the above

Answer : B

Explanation

B.SecurityTokenHandler is the appropriate class to override for creating a custom token handler

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.

Answer : A

Explanation

A.JSON are used to return JSON result in MVC

mvc_framework_questions_answers.htm
Advertisements