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 are developing an application. One requirement is that part of your data access layer needs to be available to a third party, that wants to get this information from a REST URL in XML. Your company does not have experience with web services, but you have several websites running ASP.NET MVC 4. How could you design and provide these new services? (Choose all that apply.)

A - Task an individual on staff to learn WCF, and have this individual develops and deploys these new services using WCF.

B - Use the Web API to create REST services using ApiController in which the serialization type is defined by the Accepts property of the browser.

C - Build a basic ASP.NET MVC 4 project in which the view simply passes through the information provided by the controller, and the controller manages the code for serializing the response.

D - Create an ASP.NET ASMX services file to get, serialize, and return the data.

E - B,C and D

F - All of the above

Answer : E

Explanation

E.Using ASP.NET MVC is another way to create a controller that will return XML.

Q 2 - You are creating an ASP.NET MVC 4 web application that will be accessed by a large number of traditional consumers. If you need to be able to access state information on the client side in JavaScript/jQuery, where can you store it? (Choose all that apply.)

A - LocalStorage

B - QueryString

C - ViewState

D - Cookies

E - B and D both

F - All of the above

Answer : E

Explanation

E.Query string information is available across all browsers and is usable on both the client and server.Cookies can be stored for a period of time on the client and be read from either client- or server-side operations.

Answer : F

Explanation

F.You should build in validation to check that at least one field has been populated before saving an entry.Although the partner company has not provided any requirements, your company is responsible for data entry and therefore should ensure that the data passing through the application meets some minimum criteria.The application has many entry fields so it is difficult to predict when an entry hits a valid stage. However, you already know you have constraints on the data being input because of the size of the database columns in which you will be storing them. A MaxLength validator on each field would help ensure that there is no loss of data.Although either field in the form can be anything, they should have a maximum length limit imposed so the data does not exceed the size of the database column they will be stored in. You should also validate that neither field is empty.

Answer : B

Explanation

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 - You are globalizing an application and are compiling a list of items that need to be translated. Which items should be included on the list? (Choose all that apply.)

A - Images that are used as part of the menu structure

B - The company logo

C - Server error-logging messages

D - Button tooltips

E - A and D both

F - All of the above

Answer : E

Explanation

E. Images that are being used for menus likely have text displayed on them. That text should be localized, and extra sets of buttons might have to be created.Tooltips are supposed to give extra contextual help about the item the mouse hovers over. It is important to get them translated.

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 type of authentication accepts login credentials that will be checked against the domain or local server and are sent in a hashed format?

A - Basic authentication

B - Digest authentication

C - Forms authentication

D - Windows authentication

E - A and B both

F - All of the above

Answer : B

Explanation

B.Digest authentication is a challenge-response–based authentication method to ensure that user credentials are not sent over the network in clear text.

Q 8 - WIF enables you to create a custom token. To be able to use the token, you must create a custom token handler by overriding which of the following?

A - SecurityToken

B - SecurityTokenHandler

C - SWTToken

D - Saml2SecurityTokenHandler

E - A and B both

F - All of the above

Answer : B

Explanation

B.SecurityTokenHandler is the appropriate class to override for creating a custom token handler

Q 9 - You create an ASP.NET MVC 2 Web application that contains the following controller class.public class CartController : Controller { static List products = new List(); public ActionResult Index() { return View(); }}and the Views folder of your application, you add a view page named Index.aspx that includes the following @ Page directive.<%@ Page Inherits="System.Web.Mvc.ViewPage" %> You test the application with a browser. You receive the following error message when the Index method is invoked: "The view 'Index' or its master was not found." You need to resolve the error so that the new view is displayed when the Index method is invoked.What should you do?

A - Create a folder named Cart inside the Views folder.Move Index.aspx to the Cart folder.

B - Modify the Index method by changing its signature to the following: public ActionResult Index(Cart c)

C - Change the name of Index.aspx file to Cart.aspx

D - None of above

E - A and D both

F - All of the above

Answer : A

Explanation

A.Create a folder named Cart inside the Views folder.Move Index.aspx to the Cart folder.

mvc_framework_questions_answers.htm
Advertisements