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 - A significant change has been requested in an application maintained within your company. The application is a classic ASP application that uses custom Open Database Connectivity (ODBC) drivers to connect to a relational data repository on a mainframe computer. The CIO decided that the company needs to replace this 30-year-old system. The team that worked on the original project is made up of developers who have never worked with an object-oriented approach before. Which approaches would be the best to use when designing your initial schema in Entity Framework? (Choose all that apply.)
A - Create your own custom design because it’s too much work to manage an inexperienced staff.
Answer : C
Explanation
C.The use of the Entity Designer as an integral component in the Model First approach will help unfamiliar users to walk through the process.The use of the Entity Designer as an integral component in the Model First approach will help unfamiliar users to walk through the process.
Q 2 - You are designing an ASP.NET MVC 4 application that uses an Oracle database for persistence. What session configuration choices enable you to deploy your application on a web farm? (Choose all that apply.)
Answer : E
Explanation
E.Using a shared state server across the web farm is an available option. Using a state server designates one server to maintain state for all the servers that connect to it.A custom session provider enables you to maintain state as necessary by doing the work in your custom code. It is generally used when you try to use a dif- ferent RDBMS system or when you do not want to use the default session database design.
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 are modifying an ASP.NET MVC web application for a client. The client requires that the application must be viewable on Android devices in a UI format native to the device. What should you do? (Choose all that apply.)
A - Run the Install-Package jQuery.Mobile.MVC command using the Package Manager console.
B - Create a viewport and use @media queries to make styles that are specific for Android.
C - Create corresponding mobile views for the project targeted toward Android.
D - Modify the Web.config file in Shared views in the project to add in support for other browsers.
Answer : C
Explanation
C. Text revealed by mouse-overs not being picked up by search engine crawlers indicates that content is being skipped
Q 5 - You are creating an ASP.NET MVC website and you want to replace a <h2>hello</h2>tag within the view with custom resources you have created. What should you use?
A - <h2>@mvcapp.Resources.Home.Index.Heading</h2>
B - <h2div="resource">Hello</h2>
C - <h2 class="resource">Hello</h2>
Answer : A
Explanation
A.This is the correct way to insert resources into a view
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 - Forms authentication enables you to write code to validate user credentials. After it is complete, you can register the authentication cookies for use throughout the user's visit by using which of the following?
A - FormsAuthentication.SetAuthCookie
B - FormsAuthenticationCookie = new FormsAuthenicationCookie();
Answer : A
Explanation
A.FormsAuthentication.SetAuthCookie registers the authentication token in the cookie for use in future requests
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 - The Controller class is responsible for the following processing stages:
A - Locating the appropriate action method to call and validating that it can be called.
B - Getting the values to use as the action method's arguments.
C - Handling all errors that might occur during the execution of the action method.
Answer : D
Explanation
D.All of the above.