JavaScript Questions & Answers – Page Render BottleNecks Optimization

This set of Javascript Multiple Choice Questions & Answers (MCQs) focuses on “Page Render BottleNecks Optimization”.

1. When does the browser stop rendering the HTML?
a) Inline JavaScript block
b) External JavaScript file
c) Both Inline JavaScript block & External JavaScript file
d) External HTML file
View Answer

Answer: c
Explanation: When the browser parses the HTML markup, it stops rendering the HTML when it encounters an inline JavaScript block or external JavaScript file. At this point, the user experiences rendering delays.

2. Which of the following handles painting the content on to the screen?
a) Rendering engine
b) JavaScript Interpreter
c) UI Layer
d) Network Layer
View Answer

Answer: a
Explanation: A rendering engine is a software that draws text and images on the screen. The rendering engine handles painting the content to the screen. When it encounters JavaScript, it hands it off to the JavaScript interpreter.

3. What does the rendering engine do when it encounters JavaScript?
a) Skips the code
b) Continues painting
c) Switches to Javascript Interpreter
d) Restructures the code
View Answer

Answer: c
Explanation: A rendering engine is a software that draws text and images on the screen. The rendering engine handles painting the content to the screen. When it encounters JavaScript, it hands it off to the JavaScript interpreter.
advertisement
advertisement

4. Which of the following runs the JavaScript code?
a) Just In Time compiler
b) JavaScript Interpreter
c) Both Just In Time compiler and JavaScript Interpreter
d) Javascript compiler
View Answer

Answer: b
Explanation: A JavaScript engine is a computer program that executes JavaScript (JS) code. The first JS engines were mere interpreters, but all relevant modern engines utilize just-in-time compilation for improved performance. The JavaScript Interpreter runs the JavaScript code.

5. Which of the following layer retrieves the content from the network?
a) Transport Layer
b) Application Layer
c) Network Layer
d) Physical Layer
View Answer

Answer: c
Explanation: The network layer is the third level of the Open Systems Interconnection Model (OSI Model) and the layer that provides data routing paths for network communication. The network layer retrieves the content from the network.
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

6. Which of the following gets converted to DOM elements by the rendering engine?
a) Tokens
b) Strings
c) Address
d) Characters
View Answer

Answer: a
Explanation: The string returned by the network layer gets tokenized into meaningful chunks. The rendering engine then takes the tokens and converts them to DOM elements. There are five categories of tokens: 1) constants, 2) identifiers, 3) operators, 4) separators, and 5) reserved words.

7. Which of the below does not belong to the Render Engine workflow?
a) Paint DOM elements
b) Parse Content
c) Build DOM nodes in render tree
d) Parse identifiers
View Answer

Answer: d
Explanation: A rendering engine is software that draws text and images on the screen. All of the mentioned belongs to the Render Engine workflow. The Render engine workflow contains:

  1. Parse Content
  2. Build DOM nodes in render tree
  3. Layout positioning of DOM elements
  4. Paint DOM elements.
advertisement

8. Which is the next step after retrieving the content in chunks?
a) Paint DOM elements
b) Parse Content
c) Build DOM nodes in render tree
d) Layout positioning of DOM elements
View Answer

Answer: b
Explanation: After retrieving the content in chunks, the contents will be parsed. The Render engine workflow contains:

  1. Parse Content
  2. Build DOM nodes in render tree
  3. Layout positioning of DOM elements
  4. Paint DOM elements.

9. What will happen after executing the script?
a) Execute script
b) Layout positioning of DOM elements
c) Paint DOM elements
d) Build DOM nodes in render tree
View Answer

Answer: d
Explanation: After executing the script, the DOM nodes will be built in the render tree. The Render engine workflow contains:

  1. Parse Content
  2. Build DOM nodes in render tree
  3. Layout positioning of DOM elements
  4. Paint DOM elements.
advertisement

10. What would happen if there were no script tags?
a) Build DOM nodes in render tree
b) Layout positioning of DOM elements
c) Paint DOM elements
d) Execute script
View Answer

Answer: a
Explanation: If there were no script tags, the DOM nodes will be built in the render tree. After executing the script, the DOM nodes will be built in the render tree.

Sanfoundry Global Education & Learning Series – Javascript Programming.

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.