Browser & Web Performance Interview Questions and Answers
How the browser loads and renders a page, Core Web Vitals (LCP, INP, CLS), resource loading, HTTP caching, CORS, cookies, XSS, CSP and other browser security.
225 questions for Browser & Web Performance interviews with answers and explanations - Junior, Middle and Senior levels. Sample questions, online quizzes and coding tasks.
- Core Web Vitals
- Rendering
- HTTP Cache
- CORS
- XSS
Questions by level
Junior
Core concepts and syntax · 50 questions
Middle
Practice, nuances and optimization · 50 questions
Senior
Architecture, internals, edge cases · 50 questions
Sample questions
A few questions from each level with the correct answer and an explanation.
Browser & Web Performance · Junior
- You type a URL and press Enter. Which order of steps is closest to what the browser does first?
Correct answer: DNS lookup, TCP (and TLS) connection, HTTP request, then parsing the HTML response
The browser must resolve the host name to an IP, open a connection (plus TLS for HTTPS) and send the request before it gets any HTML to parse.
- What does the browser build from the HTML it parses?
Correct answer: The DOM, a tree of nodes for the document
HTML is tokenized into nodes that form the DOM. CSS is parsed separately into the CSSOM; both are combined later.
- What is the render tree?
Correct answer: DOM and CSSOM combined, containing only the visible nodes with their computed styles
Elements with
display: noneand non-visual nodes like<head>are left out. The render tree is the input to layout. - Which order of rendering stages is correct after the render tree is built?
Correct answer: Layout, paint, composite
Layout computes geometry, paint fills in pixels for layers, and compositing draws the layers on screen in the right order.
Browser & Web Performance · Middle
- Which CSS properties can usually be animated without triggering layout or paint?
Correct answer:
transformandopacityThey can be handled by the compositor on an already painted layer, so animations stay smooth even if the main thread is busy.
- What is the risk of adding
will-change: transformto many elements?Correct answer: Each one may get its own compositor layer, costing GPU memory and sometimes making things slower
will-changeis a hint for elements that are about to animate, not a general speed-up. Overuse leads to layer explosion. - Why is
requestAnimationFramebetter thansetInterval(fn, 16)for visual updates?Correct answer: It runs right before the browser renders the next frame and pauses in background tabs
Timers drift and aren't aligned with frames, so updates can be dropped or done twice. rAF also adapts to 120 Hz displays.
- What does
content-visibility: autodo?Correct answer: Skips rendering work (layout and paint) for offscreen content until it approaches the viewport
On long pages it can greatly cut initial rendering time. Pair it with
contain-intrinsic-sizeso the scrollbar doesn't jump.
Browser & Web Performance · Senior
- What does Site Isolation in Chromium guarantee?
Correct answer: Pages from different sites are rendered in different OS processes
After Spectre, process boundaries became the main defense against one site reading another's memory, including cross-site iframes.
- Why did browsers disable
SharedArrayBufferby default and then re-enable it only for cross-origin isolated pages?Correct answer: It enables high-resolution timers useful for Spectre attacks; isolation ensures no cross-origin data shares the process
With COOP and COEP the page can't pull in cross-origin resources that haven't opted in, so a Spectre gadget has nothing secret to read.
- After enabling
COEP: require-corp, third-party images stopped loading. What are the options?Correct answer: The third party must send
Cross-Origin-Resource-Policy: cross-originor serve via CORS; or useCOEP: credentiallesscredentiallessloads no-cors cross-origin resources without cookies, so they can't contain user-specific secrets. - What does
Cross-Origin-Opener-Policy: same-originprotect against, besides enabling isolation?Correct answer: Cross-origin windows opened by or opening your page losing their
window.openerreference, which blocks many XS-Leaks and tabnabbingPopups put in a separate browsing context group can't count your frames, navigate you or measure timings via the window handle.
Combined quizzes with this topic
Questions from several topics at once - just like an interview for a specific role.
Coding tasks
Write your solution right in the browser, and tests check it instantly. JavaScript interview classics (debounce, deepClone, Promise.all, an LRU cache) and React components and hooks like a todo list, tabs, useDebounce and useInterval.
Open tasks →