JavaScript Browser Rendering Pipeline Quiz
Test your understanding of how browsers render web pages with 35 questions covering HTML/CSS/JS parsing, the Critical Rendering Path, layout, painting, compositing, and performance optimizations.
Question 1
What is the output of the HTML parser?
Question 2
What happens when the HTML parser encounters a <script> tag without async or defer?
Question 3
What does the CSS parser produce?
Question 4
Why can external stylesheets block rendering?
Question 5
What does this script placement typically cause?
<head>
<script src="app.js"></script>
</head>Question 6
What is the Critical Rendering Path?
Question 7
Which resource is NOT render-blocking by default?
Question 8
What is the purpose of the render tree?
Question 9
Which of the following helps optimize the Critical Rendering Path?
Question 10
What does First Contentful Paint (FCP) measure?
Question 11
How does JavaScript execution affect rendering?
Question 12
When is the DOMContentLoaded event fired?
Question 13
What does requestAnimationFrame() do in relation to rendering?
Question 14
What happens if you read layout properties (e.g., offsetHeight) right after a DOM mutation?
element.style.width = '200px';
console.log(element.offsetWidth);Question 15
Which task runs in the same event loop phase as rendering?
Question 16
What is layout (reflow)?
Question 17
Which CSS property change typically triggers layout?
Question 18
What is the cost of layout relative to other rendering steps?
Question 19
How can you avoid “layout thrashing” in a loop?
for (let i = 0; i < 100; i++) {
element.style.height = i + 'px';
console.log(element.clientHeight); // BAD: forces layout each iteration
}Question 20
Does changing an element’s color trigger layout?
Question 21
What is painting in the rendering pipeline?
Question 22
What enables compositing in modern browsers?
Question 23
Which CSS property commonly promotes an element to its own compositing layer?
Question 24
What happens during the compositing stage?
Question 25
Why is transform: translateX() preferred over left for animations?
Question 26
What is a key benefit of using passive event listeners?
Question 27
Which technique reduces layout impact when animating many elements?
Question 28
What does this code risk?
function updateElements() {
for (let el of document.querySelectorAll('.item')) {
el.style.top = el.offsetTop + 10 + 'px';
}
}Question 29
How can you minimize the impact of DOM mutations on performance?
Question 30
What is the purpose of the contain CSS property?
Question 31
What logs after this sequence?
const el = document.getElementById('box');
el.style.width = '100px';
el.style.height = '100px';
// Assume no layout triggered yet
console.log('done');Question 32
Which tool helps visualize the rendering pipeline in DevTools?
Question 33
What is “jank” in rendering?
Question 34
What does this CSS do for performance?
.animated {
will-change: transform;
}Question 35
Why should you avoid querying element dimensions inside a loop?
for (let i = 0; i < items.length; i++) {
items[i].style.width = container.clientWidth + 'px';
}