MVC Framework Online Quiz


Advertisements


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

E - B and D both

F - All of the above

Answer : C

Explanation

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.

Q 2 - You are creating an ASP.NET MVC 4 web application that will be accessed by a large number of traditional consumers. If you need to be able to access state information on the client side in JavaScript/jQuery, where can you store it? (Choose all that apply.)

A - LocalStorage

B - QueryString

C - ViewState

D - Cookies

E - B and D both

F - All of the above

Answer : E

Explanation

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.

Q 3 - When you are creating a custom handler, what is the parameter being passed into the ProcessRequest method?

A - object, EventArgs

B - HttpApplication

C - HttpContext

D - Object

E - A and D both

F - All of the above

Answer : C

Explanation

C.The ProcessRequest method takes the HttpContext parameter.

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.

Answer : A

Explanation

A.The FileResult property was designed for this need.

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 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 - Windows Azure ACS allows for federated identification from outside agencies such as a Microsoft account or Facebook. Which entity issues the final token that your application will accept for access?

A - The outside agency

B - Your application

C - Your network firewall

D - Windows Azure ACS

E - A and B both

F - All of the above

Answer : D

Explanation

D.ACS reads the token provided by the identity providers and creates a token that your application understands and accepts.

Q 9 - You are implementing an ASP.NET MVC 2 Web application. The URL with path /Home/Details/{country} will return a page that provides information about the named country. You need to ensure that requests for this URL that contains an unrecognized country value will not be processed by the Details action of HomeController.What should you do?

A - Add the ValidateAntiForgeryToken attribute to the Details action method.

B - Add the Bind attribute to the country parameter of the Details action method. Set the attribute's Prefix property to Country.

C - Create a class that implements the IRouteConstraint interface. Configure the default route to use this class.

D - Create a class that implements the IRouteHandler interface. Configure the default route to use this class.

E - A and D both

F - All of the above

Answer : C

Explanation

C.IrouteConstraint interface is implemented to configure default route to implement custom logic

Answer : D

Explanation

D.Partial views in mvc are the reusable views


mvc_framework_questions_answers.htm

Advertisements