Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

Which method is used to obtain the “drawing context” object?(a) getContext()(b) getObject()(c) get()(d) getDrawing()I got this question during an interview.The query is from Graphics in division Graphics and Rendering of JavaScript

Answer»

Correct choice is (a) GETCONTEXT()

The best I can EXPLAIN: The HTMLCanvasElement.getContext() method RETURNS a drawing context on the canvas, or null if the context identifier is not supported. Most of the Canvas drawing API is defined not on the canvas ELEMENT itself, but instead on a “drawing context” object obtained with the getContext() method of the canvas.

2.

SpiderMonkey was developed by _____________(a) Firefox(b) Internet Explorer(c) Safari(d) OperaThe question was posed to me in final exam.I'd like to ask this question from Browser Parsing and Rendering topic in chapter Graphics and Rendering of JavaScript

Answer»

Right answer is (a) Firefox

For explanation I would say: SpiderMonkey is MOZILLA’s JavaScript ENGINE written in C and C++. It is used in various Mozilla products, including Firefox, and is AVAILABLE under the MPL2. SpiderMonkey is the JavaScript engine made by Mozilla that is used in Firefox.

3.

Which of the following first developed Gecko?(a) Safari(b) Netscape(c) Opera(d) Internet ExplorerThis question was posed to me in my homework.Question is taken from Browser Parsing and Rendering topic in section Graphics and Rendering of JavaScript

Answer»

Correct option is (B) Netscape

Explanation: Gecko is the NAME of the layout ENGINE developed by the Mozilla Project. Gecko was first developed at Netscape, before the Mozilla Project SPUN out as its own entity, as the SUCCESSOR to the original Netscape rendering engine, back in 1997.

4.

What is the returning value of the getContext() method?(a) Drawing model(b) CanvasRenderingContext2D object(c) Context2D object(d) ContainerI got this question in my homework.My question comes from Graphics in division Graphics and Rendering of JavaScript

Answer»

Correct CHOICE is (b) CanvasRenderingContext2D object

Easy explanation: Call GETCONTEXT() with the argument “2d” to obtain a CanvasRenderingContext2D object that you can use to DRAW two-dimensional graphics into the canvas. It is important to understand that the canvas ELEMENT and its context object are two very different objects.

5.

Why is the total size of the page important?(a) Time taken to download(b) Size of IP packet should be less than 65500(c) Size of IP packet should be less than 65535(d) Size of IP packet should be greater than 65500I have been asked this question during an interview for a job.My doubt is from Browser Parsing and Rendering topic in portion Graphics and Rendering of JavaScript

Answer»

Right OPTION is (c) SIZE of IP PACKET should be less than 65535

For explanation: The total size of the page is important, not just because of the time it takes to download, but because the maximum size of an IP packet is 65535 OCTETS for IPv4 and IPv6.

6.

What is the purpose of the JavaScript Engine?(a) Compiling the JavaScript(b) Interpreting the JavaScript(c) Both Compiling & Interpreting the JavaScript(d) Parsing the javascriptThis question was addressed to me by my school teacher while I was bunking the class.My question is from Browser Parsing and Rendering topic in chapter Graphics and Rendering of JavaScript

Answer»

Correct choice is (B) Interpreting the JavaScript

The BEST I can explain: The JavaScript ENGINE is GENERALLY USED for interpreting the JavaScript. It is used to interpret the javascript and execute the javscript on the web page.

7.

What is the purpose of the canvas element?(a) Creates drawing surface(b) Exposes powerful drawing API to client-side JavaScript(c) Creates drawing surface & Exposes powerful drawing API to client-side JavaScript(d) Creates a rectangular boxThis question was addressed to me in unit test.My enquiry is from Graphics topic in chapter Graphics and Rendering of JavaScript

Answer»

The correct choice is (c) Creates DRAWING surface & Exposes powerful drawing API to client-side JavaScript

Explanation: The HTML canvas element is used to draw graphics, on the fly, via JavaScript. The canvas element is only a CONTAINER for graphics. The canvas element has no APPEARANCE of its own but creates a drawing surface WITHIN the DOCUMENT and exposes a powerful drawing API to client-side JavaScript.

8.

Which of the following render HTML?(a) Browsers(b) Email Clients(c) Web Components(d) All of the mentionedThe question was asked in final exam.This is a very interesting question from Browser Parsing and Rendering topic in portion Graphics and Rendering of JavaScript

Answer»

Right answer is (d) All of the mentioned

Easy explanation: Rendering Engine takes HTML code and interprets it into what you see VISUALLY. More TOOLS than just browsers render HTML, including EMAIL CLIENTS and web components in other applications.

9.

Which is the method invoked to begin a path?(a) begin()(b) path()(c) createPath()(d) beginPath()I had been asked this question by my school teacher while I was bunking the class.Asked question is from Graphics topic in chapter Graphics and Rendering of JavaScript

Answer»

Correct option is (d) beginPath()

EXPLANATION: The beginPath() method begins a PATH, or resets the current path. It is called before CREATING any path or CURVE.

10.

Which layer handles top-level communication?(a) Network Access Layer(b) Internet Layer(c) Transport Layer(d) Application LayerThe question was asked in homework.My doubt is from Browser Parsing and Rendering in portion Graphics and Rendering of JavaScript

Answer»

Correct choice is (d) Application Layer

Best EXPLANATION: An application layer is an abstraction layer that specifies the shared communications protocols and interface METHODS USED by hosts in a communications NETWORK. The Application layer handles the top-level communication that the client and SERVERS use, like HTTP and SMTP for email clients.

11.

Which HTML element is used to include images?(a) image(b) img(c) src(d) sourcingThe question was asked in a national level competition.Question is taken from Scripted Media topic in division Graphics and Rendering of JavaScript

Answer»

Right ANSWER is (b) img

To EXPLAIN I would say: Web pages INCLUDE images using the HTML img element. src tag is used to include the image link.

12.

Which of the following attributes are common to both audio and video?(a) enter(b) control(c) controls(d) addI had been asked this question in semester exam.Question is from Scripted Media in division Graphics and Rendering of JavaScript

Answer»

The correct option is (c) CONTROLS

For EXPLANATION I would say: Both audio and video support a controls attribute. When PRESENT, it SPECIFIES that audio controls should be displayed. Both audio and video support a controls attribute.

13.

Carakan is used by which of the following browsers?(a) Firefox(b) Internet Explorer(c) Safari(d) OperaThe question was asked in an interview for internship.Asked question is from Browser Parsing and Rendering in division Graphics and Rendering of JavaScript

Answer»

The correct ANSWER is (d) OPERA

The explanation: Opera uses Carakan, which was INTRODUCED in 2010. Mozilla uses spidermonkey and SAFARI uses nitro javascript engine.

14.

Which of the following browsers use Webkit?(a) Chrome(b) Internet Explorer(c) Safari(d) Both Chrome and SafariI have been asked this question in examination.This question is from Browser Parsing and Rendering in portion Graphics and Rendering of JavaScript

Answer»

Correct choice is (d) Both Chrome and Safari

Explanation: WebKit is a browser engine USED in Apple’s Safari browser and other products. Webkit is what Chrome and Safari use, and is your target for most mobile web DEVELOPMENT since it is used as the layout or RENDERING engine for Android devices as well as mobile Safari for iOS devices and the Silk browser on KINDLE FIRES.

15.

Which is a possible way of finding all the img elements in the document?(a) document(images)(b) document.images[](c) document(img)(d) doc(img)This question was posed to me in examination.I want to ask this question from Scripted Media in section Graphics and Rendering of JavaScript

Answer»

The correct ANSWER is (b) document.images[]

For explanation: The BEST suited option is document.image[] to FIND all img ELEMENTS in the document.[index] is used to specify the index of which img tag is to be selected.

16.

What is the return type of the remote server?(a) HTTP Response(b) HTTP Request(c) Get Request(d) Post requestThe question was posed to me during a job interview.My enquiry is from Browser Parsing and Rendering topic in division Graphics and Rendering of JavaScript

Answer»

The correct option is (a) HTTP Response

To explain I would say: The REMOTE server FINDS the resource and returns it in an HTTP Response, the status of which is 200 to indicate a good response. 400 status code is used to indicate a BAD request.

17.

Which layer is used to handle the network addressing and routing?(a) Network Access Layer(b) Internet Layer(c) Transport Layer(d) Presentation LayerThis question was addressed to me by my school principal while I was bunking the class.Question is from Browser Parsing and Rendering topic in portion Graphics and Rendering of JavaScript

Answer»

Right choice is (b) INTERNET LAYER

The explanation: The internet layer is a group of internetworking methods, protocols, and specifications in the Internet protocol suite that are used to transport network packets from the originating HOST across network boundaries. The Internet layer HANDLES network addressing and routing, getting IP and MAC ADDRESSES.

18.

Which is the method invoked to connect the last vertex back to the first?(a) closePath()(b) close()(c) connectlast(first)(d) connect()The question was posed to me in quiz.I want to ask this question from Graphics in division Graphics and Rendering of JavaScript

Answer» CORRECT choice is (a) closePath()

To explain: The closePath() METHOD connects the LAST vertex back to the FIRST, thereby creating a path. It connects the last point to the first point thereby creating a closed FIGURE.
19.

Which of the following elements are used to include audio?(a) audio(b) video(c) svg(d) audI got this question during an online exam.I need to ask this question from Scripted Media in section Graphics and Rendering of JavaScript

Answer»

The CORRECT answer is (a) audio

To explain: The audio tag is used to include audio in the HTML document. The audio tag INCLUDES method like play(), PAUSE() ETC.

20.

Which of the following uses a lot of CPU cycles?(a) GUI(b) Statically generated graphics(c) Dynamically generated graphics(d) ImagesI have been asked this question during an interview for a job.The origin of the question is Scripted Media in chapter Graphics and Rendering of JavaScript

Answer»

The correct option is (c) Dynamically generated graphics

Explanation: Dynamic graphics for DATA, means simulating motion or MOVEMENT using the computer. It MAY ALSO be thought of as multiple plots linked by time. Dynamically generating graphics from real-time data uses a lot of CPU cycles.

21.

What is the advantage of the code produced graphics being smaller than the images themselves?(a) Bandwidth saving(b) Increase in bandwidth(c) Dynamic advantages(d) Static advantageThe question was asked during an interview.Question is taken from Scripted Media topic in division Graphics and Rendering of JavaScript

Answer»

The correct answer is (a) Bandwidth saving

To explain I would say: The CODE used to PRODUCE graphics on the CLIENT side is typically much smaller than the images themselves, creating substantial bandwidth SAVINGS.

22.

Which of the following is a property used to check how crisp or fuzzy shadows are?(a) shadowColor(b) shadowBlur(c) strokeStyle(d) strokeI had been asked this question in an interview for job.The origin of the question is Graphics topic in portion Graphics and Rendering of JavaScript

Answer»

Right CHOICE is (B) shadowBlur

Explanation: shadowBlur is used to check how crisp or fuzzy SHADOWS are. The shadowBlur property sets or returns the BLUR level for shadows.

23.

How does SVG describe complex shapes?(a) Path of lines(b) Path of curves(c) Path of lines and curves(d) PlanesI had been asked this question in an online quiz.The question is from Graphics topic in portion Graphics and Rendering of JavaScript

Answer»

The correct choice is (C) Path of lines and CURVES

To explain I would say: SVG stands for ‘Scalable Vector Graphics’ and it is USED to define graphics for the WEB. SVG is mostly used for vector type DIAGRAMS like Two-dimensional graphs in an X, Y coordinate system, Pie charts etc. SVG describes complex shapes as a “path” of lines and curves that can be drawn or filled.

24.

What are the various possessions in the three-way handshake by the TCP?(a) Synchronize(b) Synchronize-Acknowledge(c) Acknowledge message(d) All of the mentionedThis question was posed to me in quiz.My question is based upon Browser Parsing and Rendering topic in chapter Graphics and Rendering of JavaScript

Answer»

Right ANSWER is (d) All of the mentioned

The best I can EXPLAIN: TCP stands for transmission CONTROL protocol which controls the transmission of data over the internet. This handshake consists of a Synchronize, Synchronize-Acknowledge, and Acknowledge message to be passed between the browser and the REMOTE server. This handshake allows the client to attempt communication, the server to acknowledge and accept the attempt, and the client to acknowledge that the attempt has been accepted.

25.

How will the HTTP GET request be sent from the browser?(a) Remote server(b) Local server(c) By itself(d) Standby ServerThe question was posed to me by my school teacher while I was bunking the class.This question is from Browser Parsing and Rendering in division Graphics and Rendering of JavaScript

Answer»

Right option is (a) Remote server

Explanation: The two most common methods of http are GET and post. Once the TCP/IP CONNECTION has been established, the browser sends an HTTP GET request over the connection to the remote server. The remote server FINDS the resource and returns it in an HTTP Response, the STATUS of which is 200 to indicate a good response.

26.

The User Interface is taken care of which layer?(a) Transport Layer(b) Network Layer(c) UI Layer(d) Presentation LayerThe question was posed to me during an interview.This intriguing question comes from Browser Parsing and Rendering in portion Graphics and Rendering of JavaScript

Answer»

Correct answer is (c) UI Layer

Explanation: The USER interface layer represents the front END of theWeb CLIENT, and contains the ACTUAL GUI elements that USERS view and click. The UI Layer takes care of the User Interface.

27.

What is the purpose of a Rendering Engine?(a) Parsing objects in page(b) Drawing all objects in page(c) Both Parsing & Drawing all objects in page(d) Rendering objectI had been asked this question in examination.This intriguing question comes from Browser Parsing and Rendering topic in portion Graphics and Rendering of JavaScript

Answer»

Correct CHOICE is (c) Both Parsing & DRAWING all objects in page

To elaborate: It’s responsible for DISPLAYING the web page. The rendering engine parses the HTML and the CSS and displays the parsed CONTENT on the screen. A Rendering Engine is GENERALLY used for parsing and drawing all of the objects in the page.

28.

Which of the following are not the properties of a canvas object?(a) fillStyle(b) strokeStyle(c) lineWidth(d) lineSizeI got this question in final exam.Enquiry is from Graphics topic in chapter Graphics and Rendering of JavaScript

Answer» RIGHT CHOICE is (d) lineSize

The explanation: The fillStyle property sets or returns the color, GRADIENT, or PATTERN used to fill the DRAWING. The strokeStyle property sets or returns the color, gradient, or pattern used for strokes. There is no property called lineSize associated with the canvas object.
29.

Which layer is used to control the communication between the hardware in the network?(a) Network Access Layer(b) Internet Layer(c) Transport Layer(d) Presentation LayerThe question was posed to me during an interview for a job.I want to ask this question from Browser Parsing and Rendering in chapter Graphics and Rendering of JavaScript

Answer»

Right ANSWER is (a) Network Access Layer

Easy explanation: The Network Access Layer is the LOWEST layer of the TCP/IP PROTOCOL hierarchy. The Network Access layer controls the COMMUNICATION between the hardware in the network.

30.

What are the features of an interpreter?(a) Shared with other properties(b) Embedded in other tools(c) Shared with other properties & Embedded in other tools(d) Used with htmlThis question was addressed to me at a job interview.This is a very interesting question from Browser Parsing and Rendering in portion Graphics and Rendering of JavaScript

Answer»

The correct choice is (c) SHARED with other PROPERTIES & EMBEDDED in other tools

To elaborate: A JavaScript ENGINE is a program or an interpreter which EXECUTES JavaScript code. The interpreter can be shared with other properties, or embedded in other tools.

31.

From which version of IE is canvas supported?(a) 7(b) 8(c) 9(d) 6I got this question during an internship interview.I'm obligated to ask this question of Graphics topic in division Graphics and Rendering of JavaScript

Answer»

Right answer is (C) 9

To explain I WOULD say: The canvas element is not SUPPORTED by IE before IE9, but it can be reasonably well emulated in IE6, 7, and 8. It is supported from version 4 in chrome and 2 in firefox.

32.

Which of the following is not the property of the video tag?(a) width(b) height(c) breadth(d) areaThe question was asked during an internship interview.My enquiry is from Scripted Media in chapter Graphics and Rendering of JavaScript

Answer»

Correct answer is (c) breadth

The EXPLANATION is: The video TAG does not contain a breadth PROPERTY. The WIDTH and HEIGHT property specifies the width and height of the video.

33.

Which layer is used to handle the HTTP requests?(a) Network Layer(b) Transport Layer(c) Application Layer(d) Presentation LayerThis question was posed to me by my school teacher while I was bunking the class.This intriguing question originated from Browser Parsing and Rendering topic in division Graphics and Rendering of JavaScript

Answer» RIGHT option is (a) Network Layer

The explanation: HTTP is a protocol which allows the FETCHING of RESOURCES, such as HTML documents. It is the foundation of any data EXCHANGE on the Web and a client-server protocol, which means requests are initiated by the recipient, usually the Web browser. The network layer is used to handle the HTTP requests.
34.

When is JavaScript called obtrusive?(a) JavaScript code is medium sized(b) JavaScript code is small(c) JavaScript code is so large(d) JavaScript code is Very smallI had been asked this question in an international level competition.Question is from Scripted Media in division Graphics and Rendering of JavaScript

Answer»

Correct option is (c) JavaScript code is so LARGE

Explanation: When the amount of JavaScript code is so large that it effectively obscures the HTML, we CALL JavaScript as obtrusive. On the other hand unobtrusive JavaScript is a best practice methodology for attaching JavaScript to the front-end of a WEBSITE.

35.

What is the purpose of image replacement?(a) To replace an image(b) To implement special effects(c) Removal of image rollovers(d) Implementation of image rolloversI had been asked this question in a national level competition.My doubt stems from Scripted Media in portion Graphics and Rendering of JavaScript

Answer»

Correct ANSWER is (d) Implementation of image rollovers

Easy explanation: Image replacement is a TECHNIQUE developed to allow designers to use image-based typesetting while MEETING accessibility requirements. One common use for image replacement is to implement image rollovers, in which an image CHANGES when the mouse pointer MOVES over it.

36.

The layer in which the TCP (or UDP) communication takes place is _____________(a) Network Access Layer(b) Internet Layer(c) Transport Layer(d) Presentation LayerI have been asked this question in class test.My question is taken from Browser Parsing and Rendering topic in division Graphics and Rendering of JavaScript

Answer»

Correct choice is (c) Transport LAYER

To elaborate: The transport layer is the layer in the OPEN system interconnection (OSI) model responsible for end-to-end communication over a network. The Transport layer is where our TCP (or UDP) communication TAKES place.