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 - You are creating an ASP.NET MVC web application. The application accepts phone number input through the applications form. When viewing the source from a browser, you find the following code:

PhoneNumber: <input id="text1" name="phoneNumber" size="10" type="text" value="" />
What Razor syntax code segment was used?

A - PhoneNumber: <input id="phoneNumber" name="phoneNumber" size="10" type="text" value="3125551212" />

B - @Html.EditorFor(model → model.PhoneNumber)

C - PhoneNumber: @Html.TextBox("phoneNumber", Request["phoneNumber"], new { @ placeholder = "3125551212"})

D - PhoneNumber: @Html.TextBox("phoneNumber", Request["phoneNumber"], new { size = 10 })

E - C and A both

F - All of the above

Answer : D

Explanation

D.This is the proper way to limit the size of a certain field that is being bound to the model.

Answer : E

Explanation

E.Using JavaScript to query the userAgent gives you information about the type of browser being used by the client.The display mode provider performs some of the analysis of the HTTP request to try and determine what kind of browser made the request.

Answer : A

Explanation

A.The FileResult property was designed for this need.

Q 6 - You are working on a AJAX-heavy site, and your script files are separated in your solution by function. You have already implemented minification and bundling, but you are still getting reports of poor performance when users try to access your pages. You cannot replicate the problem locally. What additional steps can you take and still provide the same user experience?

A - Compress all scripts locally and have the users download the compressed files rather than the uncompressed files.

B - Turn IIS compression on, turn on the option to compress dynamic pages, and set the minimum file size to 0 so that every file served will be compressed.

C - Turn IIS compression on, disable dynamic page compression, and set the minimum file size to the size of your smallest bundled script file.

D - There is nothing more to do without redesigning the site.

E - A and C both

F - All of the above

Answer : C

Explanation

C.This is an appropriate next step to try to compress the script and style files being sent to the client.

Q 7 - What default attributes or inline checks would you use to create an accepted-list scenario in ASP.NET MVC 4? (Choose all that apply.)

A - Authorize attribute

B - RequireHttps attribute

C - WebSecurity.IsAuthenticated

D - AllowAnonymous attribute

E - A and D both

F - All of the above

Answer : E

Explanation

E.AuthorizeAttribute can be put on controllers and actions to require au- thorization.AllowAnonymous can be put on controllers and actions to enable unau- thorized users access.

Q 8 - Windows Azure ACS allows for federated identification from outside agencies such as a Microsoft account or Facebook. Which entity issues the final token that your application will accept for access?

A - The outside agency

B - Your application

C - Your network firewall

D - Windows Azure ACS

E - A and B both

F - All of the above

Answer : D

Explanation

D.ACS reads the token provided by the identity providers and creates a token that your application understands and accepts.

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.

mvc_framework_questions_answers.htm
Advertisements