Dojo MCQs

Dojo MCQs

These Dojo multiple-choice questions and their answers will help you strengthen your grip on the subject of Dojo. You can prepare for an upcoming exam or job interview with these 50+ Dojo MCQs.
So scroll down and start answering.

1: When we create dijits programatically rather than declaratively we must ensure to?

A.   Call postCreate()

B.   Call startup()

C.   Call constructor()

D.   Call inherit()

2: How do we access a dijit's properties?

A.   Extension points provided by the dijit

B.   Server-side code

C.   Accessing the dijit's DOM

D.   Creating a new dijit and removing the old one

3: dojo/on is

A.   a general-purpose event handler module

B.   used to load Dojo

C.   a jQuery feature which allows you to call dojo modules

D.   bundled with dojo/off

E.   used to enable Dojo

4: What is the _WidgetBase lifecycle?

A.   startup

B.   constructor > startup > postscript

C.   constructor > postscript > startup

D.   constructor > startup

5: What does setting parseOnLoad to true do?

A.   Skip parsing as the user will parse selectively after the age is loaded

B.   Apply dojo/parse selectively to certain DOM elements after the page is loaded

C.   Apply dojo/parser to the entire body after the page is loaded

D.   Enable dojo to be used after the page is loaded

6: Which Dojo module is used to make Ajax requests?

A.   dojo/get

B.   dojo/toServer

C.   dojo/ajax

D.   dojo/request

E.   dojo/fromServer

7: Which Dijit widget should be used to validate a telephone number? In this case a telephone number is defined as a string up to 16 characters, including digits, parentheses, dashes, periods, spaces and an upper or lower case x.

A.   dijit/form/TelephoneValidator

B.   dijit/form/PhoneNumberValidator

C.   dijit/form/ValidationTextBox

D.   dijit/form/PhoneTextBox

E.   dijit/form/NumberTextBox

8: To create a table with an Ajax interface to a server, you can use

A.   dojo/Table

B.   dojox/grid/DataGrid or dgrid

C.   data/table/Grid or data/table/Ajax/Grid

D.   dijit/form/Grid or dijit/form/Table

E.   dojox/dijit/Ajax/Table

9: DojoX is

A.   DojoX is an area for development of extensions to the Dojo toolkit.

B.   Deprecated functions which are retained for backwards compatibility.

C.   Cross-platform support for embedded devices.

D.   An optimized version of Dojo for production sites which require extremely fast code.

E.   The next generation of Dojo, it is available for testing as a beta distribution.

10: What function handles the call back feature?

A.   then()

B.   after()

C.   while()

D.   where()

11: In this code: require(["dojo/request"], function(request){ request("example.json", { handleAs: "json"}).then(function(data){ // Do something }) }); data is

A.   Undefined.

B.   The string "example.json".

C.   Inserted prior to the request.

D.   The HTTP status code for the request.

E.   The content of the file example.json.

12: To create a Dijit button widget, what module must be used?

A.   dijit/form/Button

B.   buttonWidget

C.   dojo.dijit.form.Button

D.   Dijit/widget/Button

E.   Dojo/Button/Widget

13: What is dojo/store?

A.   dojo/store is used to buffer keystrokes and mouse events to allow synchronous processing.

B.   dojo/store captures screen shots to support debugging and cross-browser testing.

C.   dojo/store is used for ecommerce applications because it provides encryption within the front-end for security.

D.   dojo/store is an uniform interface for the access and manipulation of stored data.

E.   dojo/store is used only on the Konquerer browser as a shim.

14: How do you import a module? (in this case dojo/query)

A.   define(["dojo/query"], {});

B.   require([dojo/query], {});

C.   require(["dojo/query"], {});

D.   define([dojo/query], {});

15: What does the dojo/_base/declare module contain?

A.   dojo/_base/declare is used to explicitly declare variables for high precision computations.

B.   dojo/_base/declare contains JSON extensions to allow cross-domain request completion.

C.   dojo/_base/declare creates the site infrastructure and language encoding.

D.   All of these.

E.   dojo/_base/declare contains functions to define Dojo classes, which support standard Object Oriented concepts within Dojo.

16: Which code loads the dijit/form/Button module and waits until HTML has been loaded and processed?

A.   when.DomReady.use ("dijit/form/Button", function(btn){ // Do something });

B.   (dojo/domReady!).wait(["dijit/form/Button"], function(Button) { // Do something });

C.   require(["dijit/form/Button", "dojo/domReady!"], function(Button) { // Do something });

D.   (none of these)

E.   try { dojo/DomReady!(); } catch (e) { load "dijit/form/Button"; }

17: What are the main packages of Dojo?

A.   Dojo, Dijit, DojoX, and util

B.   AMD, Ajax, fX, and GUI

C.   desktop, tablet, and mobile

D.   Firefox, IE, Chrome, and Safari

E.   layout, design, font, and effects

18: What does Dojo Util provide?

A.   Utilities specific to widgets

B.   XHR, AJAX, inheritance, packaging, query, etc

C.   Dojo Util contains utility scripts including build, shrink, test and documentation support

D.   Internationalization, accessing data stores, effects, back-button handling, etc

19: What are the two ways to add Dijit widgets?

A.   none of these

B.   programmatically and declaratively

C.   inline and included

D.   with style tags

E.   using PHP

20: How do you load Dojo on your HTML page?

A.   Include main.js

B.   Include _base.js

C.   Include dojo.js

D.   Include html.js

21: What is a dijit?

A.   A widget

B.   A type

C.   A framework

D.   An object

22: What does Dojo Dijit provide?

A.   Extensions from Dojo team and third party

B.   XHR, AJAX, inheritance, packaging, query, etc

C.   UI widgets

D.   Internationalization, accessing data stores, effects, back-button handling, etc

23: What is JSON?

A.   JavaScript Origin Node

B.   JavaScript Original Notation

C.   JavaScript Optimal Notation

D.   JavaScript Object Notation

E.   JavaScript Optimized Node

24: What does dom.byId() return?

A.   Reference to the DOM element

B.   Reference to the dijit

C.   An event handler

D.   Reference to the document

25: What does dojo DojoX handle?

A.   Foundation elements of Dojo

B.   Deprecated code

C.   Extensions and experimental code from the Dojo team and third party

D.   The Dijit widgets

26: When should you use a built version of Dojo?

A.   You should never use a built version of Dojo.

B.   A built version of Dojo should be used when you need to minimize the amount of code downloaded and the number of requests made.

C.   There is no build system for Dojo. The advantages of AMD eliminate the need for builds.

D.   The Dojo build process should only be used for mobile device applications.

E.   A built version of Dojo eliminates the need for public and private caching, speeding delivery with redundant requests.

27: What server-side technology can Dojo work with?

A.   Dojo works only with PHP and Java. Other languages integrations are being developed and expect to be deployed by the end of 2013.

B.   Dojo is a client-side, back-end agnostic technology that can be used in conjunction with ANY server-side technology.

C.   Dojo does not work with ANY server side technology. Web applications that use Dojo must load ALL data and content prior to execution because once the page is loaded additional requests are impossible.

D.   Dojo works only with Microsoft technology and performs best with Internet Explorer, version 6.0 and earlier.

E.   The Java in JavaScript means that Dojo only works with Java code, on both the client and server-side.

28: lang.replace("title/{home}/{page}", {home: "dojo", page:"1.8.1.0"}) produces what result?

A.   "title/dojo/{page}"

B.   "title/dojo/1.8.1.0"

C.   "title/{home}/{page}"

D.   "title/{home}/1.8.1.0"

29: When does the function in require(["dojo/domReady!"], function() {}); execute?

A.   When the DOM has finished loading

B.   dojo/domReady! is not a valid Dojo module

C.   It will give an error since domReady was not passed in as a parameter

D.   After Dojo has loaded but before the DOM is ready

30: What is one way to add a click handler to a button?

A.   button.on.click = function(e){ // handle event });

B.   function on(button, "click") { // handle event }

C.   call(button, "click", function(e) { // handle event });

D.   on(button, "click", function(e){ // handle event });

31: How is JSON-P different than JSON?

A.   JSON-P is delivered by servers which use PHP, Perl or Python due to the technology integration with Apache.

B.   JSON-P uses the UTF-8P character set which extends the data range of the encoding to transmit more information faster.

C.   JSON-P is a white-space padded version of JSON which is easier for both machines and people to read.

D.   JSON-P works by making a <script> element (either in HTML markup or inserted into the DOM via JavaScript), which requests to a remote data service location.

E.   There is no difference.

32: What does dojo/hash provide?

A.   A hash table

B.   An object to store data

C.   Interface to the browser's URL hash

D.   Interface to advanced data structures

33: What does registry.byId() return?

A.   Reference to the document

B.   Reference to the tag

C.   Reference to the dijit

D.   Reference to the element

34: Which module provides enhancements to native Array functions which may not be available?

A.   dojo/Array

B.   Array

C.   Dojo does not provide enhancements for array functions

D.   dojo/_base/array

E.   dojo/array

35: The annotation data-dojo-attach-point='foo' allows us to do what?

A.   Prevent the DOM node from being changed

B.   Position the DOM node on the page

C.   Allow the annotated DOM to be editable

D.   Allow access to the DOM node by the widget

36: How do you use dojo/query to get all elements with class "foo"?

A.   query("#foo");

B.   query("foo");

C.   query(".foo");

D.   query("class:foo");

37: What do compliant async functions return?

A.   Defered object

B.   JavaScript object

C.   JavaScript function

D.   an event

38: Why should you place the script tag that loads Dojo at the end of the document body?

A.   Browsers process script tags in the document body using a faster algorithm than those in the head section.

B.   The script tag should always be in the page header.

C.   None of these answers.

D.   Because Dojo tests to see where the tag used to load it from is located and will fail to execute otherwise.

E.   Because most pages have some HTML elements which must be ready for use before Dojo can run.

39: AMD is an acronym for

A.   Ajax Modules Dojo

B.   Asynchronous Module Definition

C.   Asynchronous Multiple Deferred

D.   Asynchronous Module Dojo

E.   Ajax Multiple Definition

40: Is there a CDN for Dojo?

A.   Yes.

B.   You should never use a CDN with a JavaScript library.

C.   No, you must install Dojo on your server.

D.   Dojo is bundled with the _Mojo_ library on all major CDNs.

E.   Dojo is distributed on CDs which must be purchased. N refers to the version.

41: What does lang.getObject("foo.bar") return?

A.   The normalized string "foo.bar"

B.   Value of bar nested in foo

C.   The bar property of foo

D.   The translation of foo.bar into the current locale

42: How do you bind a function to response to UI events?

A.   hitch()

B.   on()

C.   when()

D.   bind()

43: What does lang.hitch() do?

A.   Bind a function to the widget

B.   Call a function in the context of a widget

C.   Concatenate two JSON objects together

D.   Concatenate two strings together

44: What does dojo/has do?

A.   Check if Dojo is already loaded

B.   Check the browser version

C.   Check if the browser supports a feature

D.   Check the browser type

45: How does a function and it's call back behave?

A.   Run the call back before you run the code

B.   Run the function then run the call back once we enter the function

C.   Run the function and the call back asynchronously

D.   Run the function then invoke the call back

46: What is dojo/domReady! ?

A.   dojo/domReady! is a documentation convention used to remind coders to include a timeout to ensure the DOM is ready prior to execution.

B.   dojo/domReady! is an AMD loaded plugin that will wait until the DOM has finished loading before returning.

C.   dojo/domReady! parses the DOM, applying the Dijit widget code to the HTML, which readies the page for use.

D.   dojo/domReady! provides an audible beep which alerts the user the page is ready for use.

E.   dojo/domReady! loads the DOM into Dojo and fires the pageFullyLoaded event.

47: What is dojo/when used for?

A.   Binding functions to dijits

B.   Handlling synchronous code but not async code

C.   Handling both async and synchronous code

D.   Handling async code but not synchronous code

48: How do I query a store using complex criteria (month > 10)?

A.   dates.query(function(date){return date.getMonth() > 10});

B.   dates.query({month > 10});

C.   dates.query({month: "11"}) + dates.query({month: "12"})

D.   dates.query({month: "10"}) + dates.query({month: "11"}) + dates.query({month: "12"})

49: What do dijits not offer?

A.   Extensible UI controls

B.   Using preexisting dijits

C.   Accessing data stores

D.   Internationalisation

50: How do we define an internationalisation nls file? (denoted NLSFILE)

A.   define(["dojo/i18n./NLSFILE"], funtion(nlsFile){});

B.   define(["dojo/i18n/!NLSFILE"], funtion(nlsFile){});

C.   define(["dojo/i18n!NLSFILE"], funtion(nlsFile){});

D.   define(["dojo/i18n/NLSFILE"], funtion(nlsFile){});