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

B - Create an individual model for each of the data requests, and then create a view- specific model that calls those models and merges the data.

C - Create a model for the summary data and handle the various data requests within that model as well as the merging of the data.

D - Create an individual model for each of the data requests and then merge the data on the client side for display.

E - C and D both

F - All of the above

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

A - Data caching

B - Page output caching with duration of two minutes

C - Page output caching with duration of four hours

D - Windows AppFabric caching

E - A, C and D

F - All of the above

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?

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.

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

A - webkit-

B - ms

C - o

D - hp

E - moz

F - B , D and E

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.

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

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 8 - Which methods help the RoleProvider determine whether a user is assigned a role or set of roles? (Choose all that apply.)

A - GetRoles

B - GetRolesForUser

C - IsUserInRole

D - FindUsersInRole

E - B and C both

F - All of the above

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,

D - Filter out keywords and symbols.

E - B and C both

F - All of the above

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.

Answer : A

Explanation

A.JSON are used to return JSON result in MVC

mvc_framework_questions_answers.htm
Advertisements