- MVC Framework Tutorial
- MVC Framework - Home
- MVC Framework - Introduction
- MVC Framework - Architecture
- MVC Framework - ASP.NET Forms
- MVC Framework - First Application
- MVC Framework - Folders
- MVC Framework - Models
- MVC Framework - Controllers
- MVC Framework - Views
- MVC Framework - Layouts
- MVC Framework - Routing Engine
- MVC Framework - Action Filters
- Advanced Example
- MVC Framework - Ajax Support
- MVC Framework - Bundling
- Exception Handling
- MVC Framework Useful Resources
- Questions & Answers
- MVC Framework - Quick Guide
- MVC Framework - Resources
- MVC Framework - Discussion
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.
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?
B - Put a synchronous service call into the main page controller.
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.
Q 2 - What is the first request sent to start HTTP polling?
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)
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
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 have a set of requirements that expects a particular action to be accessed only through HTTPS by an authenticated user. What is the best way to meet these requirements?
A - Use the Authorize attribute before the RequireHttps filter.
B - Use the RequireHttps attribute before the Authorize filter.
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
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?
Answer : C
Explanation
C.You configure specific monitors that will run in your application in the Diagnostics.wadcfg file.
Q 8 - Why should you create a custom role provider? (Choose all that apply.)
A - To use a data source not regularly supported
B - To use the SimpleRoleProvider
C - To use a database design different than .NET provides
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.
Q 9 - Which of the following statement is false about MVC in .NET?
A - Complete control over your HTML Markup
B - Makes Test Driven Development (TDD) very difficult
C - Allows you to create SEO-friendly URLs for your site
Answer : B
Explanation
B.Makes Test Driven Development (TDD) very difficult
Q 10 - what is strongly typed view in mvc
A - view created with model class
B - view having same name as class
C - view created with strong keyword
Answer : A
Explanation
A.Strongly typed views are created with model class
To Continue Learning Please Login
Login with Google