- 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 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.
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 adding a reporting vertical to an enterprise application. Many of the reports will be run every morning by a set of users. Some of the reports will be identical as every member of a team will get the same report sometime in the morning. What kind of caching will provide an improvement in performance? (Choose all that apply.)
B - Page output caching with duration of two minutes
Answer : E
Explanation
E.Data caching with the appropriate timeout will enable the data needed for the reports to be stored so that the call to the database is not necessary.A page output caching of four hours caches the output of the report for the whole morning and should eliminate the need for the report to be run a second time.AppFabric caching acts much like data caching to eliminate the need for additional calls to the database to generate the reports.
Q 3 - Your team is building an application and you are reviewing the functional specifications. Your team must include a stockticker in the UI that displays the companys stock price every 15 minutes, and include the capability to do partial saves of base objects as users step through a data entry wizard. You want to use the same approach for both requirements to make it easier to add functionality and maintain it going forward. What approach should you use?
Answer : B
Explanation
B.The best way to solve this issue is to use AJAX to do asynchronous calls to check the stock price as well as manage the save process through the wizard.
Q 4 - You want to support the Internet Explorer, Firefox, and Opera web browsers in your application. Which vendor-specific extensions do you need to include with CSS3 properties? (Choose all that apply.)
Answer : E
Explanation
E.The -ms- prefix is used for Internet Explorer. The -o- prefix is used for the Opera browser.The -moz- prefix is used for Mozilla Firefox.
Q 5 - You are the lead developer on a team that has been working on a large website for months, and several controllers are getting unwieldy. You do not have that problem with views and models because most of your communications are through AJAX to display snippets of information on the UI. What changes can best help you solve your problem? (Choose all that apply.)
B - Create an area called AJAX. Move all controllers, models, and views into the area.
Answer : E
Explanation
E.Creating partial classes offers some relief to the problem that you are ex- periencing, although not as much as a more-functional separation such as offered by areas. You do not have to make any UI changes, however. Your best move is to separate the AJAX components into an area. You would have to change all the calls to it, but you would achieve complete separa- tion of concern for AJAX calls.
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 - Using custom error pages provides a lot of flexibility to an application because it allows for a consistent user experience even when the application has a problem. To take full advantage of this flexibility, you need to be able to create the pages and configure the application to use these pages. What code will provide custom error pages for 404 errors and general exceptions?
Answer : B
Explanation
B.This example shows the 404 error status and it sets the default error han- dler to the server error action
Q 8 - Which methods help the RoleProvider determine whether a user is assigned a role or set of roles? (Choose all that apply.)
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 - A SQL injection attack occurs when an application allows input submitted by the client to be run as part of a SQL command. What actions should a developer take to ensure that this doesn't happen? (Choose all that apply.)
A - Use Entity SQL because it does not suffer from the same risk.
B - Use SQLParameters to submit the parameters.
C - Use Linq-to-Entities to access the database,
Answer : E
Explanation
E.Using SQLParameters is the best way to manage this risk.Linq-to-Entities uses an object model as access into the data layer, so the risk is mitigated.
Q 10 - . How to return the JSON from action method in ASP.Net MVC?
Answer : A
Explanation
A.JSON are used to return JSON result in MVC