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 - What occurs if an unhandled error is fired on a startup task?
Answer : B
B.The task will stop processing and return a non-zero value.
Q 2 - You are building an application in which you want to display updated information to a website every 15 minutes. What are efficient ways to manage the update? (Choose all that apply.)
Answer : E
E.WebSockets can be used to pass information between the client and server.HTTP polling with 15-minute intervals is a valid way to get the informa- tion within the required time frame.
Q 3 - Layout.cshtml and Site.Master are the two default template pages in ASP.NET MVC. Which of the following scenarios would best be solved using a single layout or master template? (Choose all that apply.)
Answer : E
E.Adding logic to the master page to determine the menu design enables your application to display a menu section that changes based on the area of the application the user is visiting.Referencing all style pages in a single place, the layout page, is an appropriate use.
Q 4 - You are creating a different view for each of several different browsers/devices, such as Home.iemobile.cshtml and Home.IPad.cshtml. What is the best way to implement it so your application knows to look for the specific views?
Answer : B
B.Adding a DisplayModeProvider for each type of special view, such as IEMobile or IPad, informs the framework to use those views where the context condition is fulfilled.
Q 5 - Your application manages the sale of expensive well-drilling equipment. Your IT director wants you to add functionality that sends an email to a customer's sales account manager whenever someone from your client company logs in to the system. What is an appropriate solution?
A - Override the AuthorizeAttribute and apply it to the login action. Run the base method first to handle the authentication and then evaluate the status of the request. If the user is a customer, send the email.
C - Override the AuthorizeAttribute that is applied to the login action, check for the user's authentication status, and determine whether it is a customer prior to sending it to the base authentication method.
Answer : D
D.This is be applied only because the user is leaving the login section of the application, at which point you also know whether they have been authenticated
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?
Answer : C
C.This is an appropriate next step to try to compress the script and style files being sent to the client.
Q 7 - Your ASP.NET MVC web application has just been released to a group of pilot users. The users are reporting periods of extreme performance degradation. You did not encounter performance issues during development or the quality assurance phase. What can you do in your development environment to understand what is occurring in the production environment?
D - Create a set of web tests that exercise the application. Using a goal-based approach, set the process to run to 75 percent CPU utilization. When you reach that point, compare the results with the number of users in the pilot program.
Answer : C
C. Starting from a midlevel count of users and then increasing to the total number of possible numbers should give you an idea of what is happening during the day-to-day running of the application in production
Q 8 - What kind of helper methods does WebSecurity provide? (Choose all that apply.)
Answer : F
F.Login is one of the methods provided by the WebSecurity helper.ResetPassword is one of the methods provided by the WebSecurity helper.CreateAccount is one of the methods provided by the WebSecurity helper.ChangePassword is one of the methods provided by the WebSecurity helper.
Q 9 - You are developing an ASP.NET MVC 2 application. A view contains a form that allows users to submit their first name. You need to display the value that is submitted, and you must ensure that your code avoids crosssite scripting. Which code segment should you use?
Answer : B
B.<%: Model.FirstName %> avoids cross site scripting
Q 10 - what is strongly typed view in mvc
Answer : A
A.Strongly typed views are created with model class