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

B - Use Code First.

C - Use Model First or Use Database First.

D - None of the Above

E - B and D both

F - All of the above

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

A - InProc

B - SQLServer

C - StateServer

D - Custom session provider

E - C and D both

F - All of the above

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?

A - Use JavaScript to refresh the page every 15 minutes and to manage whether wizard buttons are enabled or disabled.

B - Use AJAX to make asynchronous calls to the server on a timer for the stock price and to automatically save the base objects as the user navigates through the wizard.

C - Use jQuery to refresh the page every 15 minutes and to manage whether wizard buttons are enabled or disabled.

D - Use data validation annotations on the model to ensure that the stock price is validated every 15 minutes and that the client saves the base object information after every wizard step.

E - C and A both

F - All of the above

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.

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>

D - <h2>@mvcapp.Resources.Home.Index.HeadingHello</h2>

E - C and B both

F - All of the above

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

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 - 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();

C - FormsAuthentication.ClearAuthCookie

D - MembershipProvider.User =

E - A and B both

F - All of the above

Answer : A

Explanation

A.FormsAuthentication.SetAuthCookie registers the authentication token in the cookie for use in future requests

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


mvc_framework_questions_answers.htm

Advertisements