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 are designing an application in which a section of the main page will be populated by content from a third-party provider. You do not have control over the responsiveness of the client or how much information will be returned with each request. The call is to a Restful service and will return the information formatted in Extensible Markup Language (XML). What is the best way to implement this application?

A - Design a model that handles the data call to populate the model. Create a partial view containing only this display area and put an asynchronous service call that returns this model in the partial view controller.

B - Put a synchronous service call into the main page controller.

C - Create a partial view containing only this display area and put a synchronous service call in the partial view controller.

D - Create a partial view containing only this display area and put an asynchronous service call in the partial view controller.

E - A and D both

F - All of the above

Answer : A

Explanation

A.Because you do not have control over the responsiveness of the third- party provider and you do not know how much data might be returned from each call, you should wrap the call in the asynchronous framework. Providing the data in a strongly-typed model gives it more flexibility than working with the raw XML on the client side.

Answer : B

Explanation

B.The first request to open a WebSocket connection is a standard HTTP GET. After the request is received, the browser sends a separate upgrade request

Q 3 - You are creating an ASP.NET MVC web application. The application must accept user input for a ProductName field. To reduce delays due to invalid entries making round trips between the client and server, user input should be validated on the client before being submitted to the server. Which code segment should you choose?

A -

@Html.LabelFor(model ⇒ model.ProductName)
@Html.EditorFor(model ⇒ model.ProductName)

B -

@Html.LabelFor(model ⇒ model.ProductName)
@Html.ValidationMessageFor (model ⇒ model.ProductName)

C -

@Html.EditorFor(model ⇒ model.ProductName)@Html.ValidationMessageFor(model⇒model.ProductName)

D -

@Html.LabelFor(model ⇒ model.ProductName)

E - C and A both

F - All of the above

Answer : C

Explanation

C.@Html.EditorFor, in combination with @Html.ValidationMessageFor, are used for client-side validation.

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 : B

Explanation

B.It filters out those users not on an SSL connection before performing the more resource-intensive authentication check.

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.

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 : B

Explanation

B.Makes Test Driven Development (TDD) very difficult

Answer : A

Explanation

A.Strongly typed views are created with model class

mvc_framework_questions_answers.htm
Advertisements