Browser runtime
What the browser adds around the language: the DOM, events, the rendering pipeline, the HTML event loop, and Web APIs. Frontend interviews test this layer constantly — "why is this click handler slow" is a browser question, not a framework one.- 10
- chapters
- 51
- questions
- 12
- core
- 851
- flashcards
- 51 not yet reviewed
- Last verified October 2026
01The DOM6 questions
The document as a tree of objects: node types, live and static collections, attributes versus properties, and inserting, moving, querying and serialising nodes.- What is the DOM, and how do nodes, elements, and the document relate?
- What's the difference between a live
HTMLCollectionand a staticNodeList? - What's the difference between an attribute and a property?
- How do you insert, move, and remove nodes efficiently?
- How do
innerHTML,textContent,innerText, andsetHTML()differ? - How do
querySelector(),closest(),matches(), andTreeWalkerfind nodes?
02Events7 questions
How the DOM delivers events: the dispatch path and its phases, delegation, default actions, listener options, custom events, timing relative to microtasks, and choosing input events.- How does event dispatch work — capture, target, and bubble?
- What is event delegation, and when does it break?
- What's the difference between
preventDefault(),stopPropagation(), andstopImmediatePropagation()? - What do the
once,passive,capture, andsignallistener options do? - How do you create and dispatch custom events, and what does
isTrustedmean? - Is
dispatchEvent()synchronous, and why do microtasks run differently for a real click? - Which input events should you listen to — pointer, mouse, touch, keyboard, or
input?
03The HTML event loop5 questions
The browser's event loop beyond tasks and microtasks: where rendering happens, animation frames, timer accuracy, task priorities and idle callbacks. The language-level loop is in JavaScript's async chapter.- Where does rendering happen in the event loop?
- How does
requestAnimationFramework, and when do its callbacks run? - Why doesn't
setTimeout(fn, 0)run after 0 ms? - How do you schedule work by priority with
scheduler.postTask()andscheduler.yield()? - What does
requestIdleCallbackguarantee, and when does it never run?
04The rendering pipeline5 questions
How bytes become pixels: parsing, style, layout, paint and compositing, how scripts and style sheets block the parser or rendering, and which operations force layout.- How does the browser turn HTML and CSS into pixels?
- How do
defer,async, and module scripts change loading and execution order? - What blocks the parser, and what blocks rendering?
- Which DOM reads force a synchronous layout, and why?
- What is compositing, and why do
transformandopacityanimate cheaply?
05Network APIs4 questions
The browser's request APIs: whatfetch()resolves and rejects with, the options that change a request, streaming bodies, and sending data as a page goes away.- Why doesn't
fetch()reject on a 404, and when does it reject? - What do
fetch()options likemode,credentials, andcachecontrol? - How do you stream a response body and show download progress?
- How do you send data reliably when the user leaves the page?
- Why doesn't
06Storage5 questions
Where a page can keep data: cookies, Web Storage, IndexedDB and the Cache API, how each is scoped and shared, and how much the browser lets a site keep.- Cookies,
localStorage,sessionStorage, or IndexedDB — how do you choose? - How do cookies work — which requests carry them, and for how long?
- How do
localStorageandsessionStoragebehave across tabs? - How does IndexedDB work, and why do its transactions commit on their own?
- How much can a site store, and when does the browser delete it?
- Cookies,
07Workers5 questions
Running script off the main thread: dedicated workers, whatpostMessagecan send, the service worker lifecycle and fetch interception, and talking between tabs.- What are Web Workers, and what can't they do?
- What does
postMessage()copy, what can it transfer, and what can't it send? - How does the service worker lifecycle work, and how do updates reach users?
- How does a service worker intercept requests, and which caching strategies are common?
- How do tabs of the same site talk to each other?
08Observers4 questions
Asynchronous callbacks for things the page would otherwise poll for: visibility, size, and DOM mutations, and where each observer's callback runs in the event loop.- How does
IntersectionObserverwork, and why use it over scroll listeners? - What does
ResizeObserverreport, and what is the loop error? - How does
MutationObserverbatch changes? - When do observer callbacks run compared with events, microtasks, and rendering?
- How does
09Navigation and page lifecycle5 questions
Moving between views and pages: the History and Navigation APIs behind client-side routing, View Transitions, the back/forward cache, and the events a page gets as it is hidden or left.- How does client-side routing work with the History API?
- What does the Navigation API fix over the History API?
- How do View Transitions work within a page and across pages?
- What is the back/forward cache, and what keeps a page out of it?
- Which page lifecycle events can you rely on when a page is hidden or closed?
10Web Components5 questions
The platform's component model: custom elements and their lifecycle, shadow DOM encapsulation, templates and slots, declarative shadow DOM, and custom elements that join forms.- How do custom elements work, including their lifecycle and upgrades?
- What does shadow DOM encapsulate, and what crosses the boundary?
- How do
<template>and<slot>work? - What is declarative shadow DOM, and why does it matter for server rendering?
- How can a custom element take part in a form?