completefrontend
WEB PERFORMANCE INTERVIEWS

Web performance interview questions

151 questions about web performance, the way interviewers ask them: 117 to explain, 21 where you say what some JavaScript or a real page in Chrome logs, and 13 where you write the function. 36 easy, 100 medium, and 15 hard. Every page's answer is what real Chrome did with it, the same in three loads in a row, and every code answer passes its tests.

Every question is free to read. Sign in with Google to see the answers: the short version to say in the interview, why it's true, and what they'll ask next.

151 of 151 questions

Why speed matters & the metrics

  1. What is web performance, and what are you actually optimizing?ConceptEasy
  2. Why does page speed matter to a business?ConceptEasy
  3. What's perceived performance, and how can a page feel faster without being faster?ConceptEasy
  4. What's the difference between lab data and field data?ConceptEasy
  5. Why do performance teams look at the 75th percentile, not the average?ConceptEasy
  6. What are the Core Web Vitals?ConceptEasy
  7. Which metric tells you about loading, interactivity, and visual stability?ConceptMedium
  8. What response times feel instant, and when do people lose focus?ConceptEasy
  9. How are these five numbers rated?Predict the outputEasy
  10. What's the 75th percentile of these samples?Predict the outputEasy
  11. Write a function that returns the share of good samples.Write the codeEasy

Core Web Vitals: LCP, INP, CLS

  1. What is Largest Contentful Paint, and what counts as the largest element?ConceptEasy
  2. Why did INP replace First Input Delay?ConceptMedium
  3. What is Interaction to Next Paint?ConceptEasy
  4. How is Cumulative Layout Shift calculated?ConceptMedium
  5. What are session windows in CLS?ConceptMedium
  6. What are the thresholds for good LCP, INP, and CLS?ConceptEasy
  7. When does the browser stop reporting LCP candidates?ConceptMedium
  8. Which layout shifts don't count toward CLS?ConceptMedium
  9. What CLS do these layout shifts add up to?Predict the outputMedium
  10. What INP do these interactions give?Predict the outputMedium
  11. Which element does the browser report as the LCP?Predict the outputMedium
  12. Write a function that finds the element behind the largest layout shift.Write the codeMedium

Measuring: lab, field & the performance APIs

  1. How does Lighthouse score performance?ConceptEasy
  2. Why can Lighthouse say fast while real users see slow?ConceptMedium
  3. What is the Chrome UX Report?ConceptEasy
  4. How would you find out why a page is slow in the Performance panel?ConceptMedium
  5. What does buffered: true do on a PerformanceObserver?ConceptMedium
  6. What can Navigation Timing tell you about a page load?ConceptMedium
  7. Why do some Resource Timing entries show zero sizes and times?ConceptMedium
  8. What are performance marks and measures for?ConceptEasy
  9. How are Long Animation Frames better than long tasks?ConceptHard
  10. What should a real user monitoring setup collect and how should it send it?ConceptMedium
  11. What does this Lighthouse score calculation print?Predict the outputMedium
  12. Write a function that turns a navigation entry into a waterfall of phases.Write the codeMedium

Networks, protocols & TTFB

  1. What's the difference between latency and bandwidth?ConceptEasy
  2. What happens before the first byte of a page arrives?ConceptEasy
  3. How does HTTP/2 make loading faster than HTTP/1.1?ConceptMedium
  4. What does HTTP/3 fix that HTTP/2 couldn't?ConceptHard
  5. What makes TTFB slow, and how do you fix it?ConceptMedium
  6. How does a CDN make pages faster?ConceptEasy
  7. Gzip, Brotli, or Zstandard: what's the difference?ConceptMedium
  8. What are 103 Early Hints?ConceptMedium
  9. Why does the first 14 KB of HTML matter?ConceptMedium
  10. How long do these connection phases take?Predict the outputEasy
  11. Write a function that estimates load time from round trips.Write the codeMedium

Caching & service workers

  1. What does Cache-Control: max-age do?ConceptEasy
  2. What's the difference between no-cache and no-store?ConceptMedium
  3. Why do hashed file names let you cache forever?ConceptMedium
  4. How does an ETag save bandwidth?ConceptMedium
  5. What does the Vary header do to caching?ConceptHard
  6. What does stale-while-revalidate do in Cache-Control?ConceptMedium
  7. What's s-maxage, and when do you use it?ConceptMedium
  8. Which service worker caching strategy would you use for each kind of file?ConceptMedium
  9. What is the back/forward cache, and what stops a page from using it?ConceptMedium
  10. Is this cached response fresh?Predict the outputMedium
  11. What does the second load log for each file's transfer size?Predict the outputMedium
  12. Write a cache-first service worker handler.Write the codeMedium

The critical path, resource hints & priorities

  1. What is the critical rendering path?ConceptEasy
  2. Why does CSS block rendering?ConceptEasy
  3. Preload, prefetch, and preconnect: when do you use each?ConceptMedium
  4. What does fetchpriority change?ConceptMedium
  5. What is the preload scanner, and what hides files from it?ConceptMedium
  6. Should you inline critical CSS?ConceptMedium
  7. Why shouldn't the LCP image be lazy-loaded?ConceptEasy
  8. Why is a CSS background image a slow LCP?ConceptMedium
  9. How does streaming HTML help the first paint?ConceptMedium
  10. Which priority does Chrome give each image?Predict the outputMedium
  11. In what order do these scripts run?Predict the outputMedium
  12. Write a function that builds the preload links a page needs.Write the codeEasy

Images, video & fonts

  1. Which image format should you use?ConceptEasy
  2. How do srcset and sizes pick an image?ConceptMedium
  3. How does loading="lazy" work, and when shouldn't you use it?ConceptEasy
  4. Why do images need width and height attributes?ConceptEasy
  5. What does an image CDN do?ConceptMedium
  6. How do you make a video or an embed cheap to load?ConceptMedium
  7. What do the font-display values do?ConceptMedium
  8. How do you load web fonts fast?ConceptMedium
  9. How do you stop a font swap from shifting the layout?ConceptHard
  10. Which srcset candidate does this pick?Predict the outputMedium
  11. Which images does this page request before you scroll?Predict the outputMedium
  12. Write a function that picks a fallback font's size-adjust and overrides.Write the codeMedium

JavaScript cost & third parties

  1. Why is a kilobyte of JavaScript more expensive than a kilobyte of image?ConceptEasy
  2. What is code splitting?ConceptEasy
  3. How does tree shaking work, and what stops it?ConceptMedium
  4. How do you find what's making a bundle big?ConceptMedium
  5. Do you still need polyfills?ConceptMedium
  6. How do you keep third-party scripts from slowing a page?ConceptMedium
  7. What's a facade for a third-party embed?ConceptMedium
  8. What's the difference between minifying and compressing?ConceptMedium
  9. What does modulepreload do?ConceptMedium
  10. When does the dynamically imported module run?Predict the outputMedium
  11. Write a function that splits a route map into chunks.Write the codeMedium

The main thread & responsiveness

  1. What is a long task?ConceptEasy
  2. What are the three parts of an interaction's latency?ConceptMedium
  3. How do you break up a long task?ConceptMedium
  4. What does scheduler.yield() do that setTimeout doesn't?ConceptMedium
  5. When should work move to a web worker?ConceptMedium
  6. When does the browser get a chance to paint?ConceptMedium
  7. What is requestIdleCallback good for?ConceptMedium
  8. Why can a fast event handler still give a slow INP?ConceptHard
  9. How do you make typing in a search box feel instant?ConceptMedium
  10. In what order do the yield continuation and the timeout run?Predict the outputMedium
  11. Which of these tasks are long, and what's the blocking time?Predict the outputMedium
  12. Write runWhenIdle(task), which runs a task in an idle callback, or after a timeout, and can be cancelled.Write the codeMedium

Rendering, layout shifts & animation

  1. What are the steps of the rendering pipeline?ConceptEasy
  2. What is a forced synchronous layout?ConceptMedium
  3. Which CSS properties can animate without layout or paint?ConceptMedium
  4. What does will-change do, and why not use it everywhere?ConceptMedium
  5. What does content-visibility: auto do?ConceptMedium
  6. What does CSS contain do?ConceptMedium
  7. What causes layout shifts, and how do you fix them?ConceptEasy
  8. How do you keep an ad slot from shifting the page?ConceptMedium
  9. How does a virtual list render 10,000 rows fast?ConceptMedium
  10. What CLS does this page log?Predict the outputMedium
  11. What is this layout shift's score?Predict the outputMedium
  12. Write a function that finds which animations aren't compositor-friendly.Write the codeMedium

Rendering strategies, frameworks & navigations

  1. CSR, SSR, SSG: what does each do to the first paint?ConceptEasy
  2. What does hydration cost?ConceptMedium
  3. What is streaming server rendering?ConceptMedium
  4. What are islands, and what do they save?ConceptMedium
  5. How are single-page app navigations measured?ConceptMedium
  6. What are speculation rules, and when would you prerender?ConceptMedium
  7. How do you make a page eligible for the back/forward cache?ConceptMedium
  8. Do view transitions slow navigations down?ConceptMedium
  9. When does rendering at the edge help TTFB?ConceptMedium
  10. How do Server Components change how much JavaScript ships?ConceptHard
  11. What does Chrome report when a single-page app changes route?Predict the outputMedium
  12. Write a function that picks speculation rules for a page's links.Write the codeMedium

How browsers do it inside

  1. How does Chrome decide a request's priority?ConceptMedium
  2. What do the main thread, the compositor, and the raster threads each do?ConceptHard
  3. How does V8 run JavaScript: parsing, tiers, and the code cache?ConceptHard
  4. How does the browser compute LCP?ConceptMedium
  5. How does the browser compute a layout shift?ConceptHard
  6. How does HTTP/2 prioritization work, and what replaced its tree?ConceptHard
  7. What happens in a QUIC connection's first round trip?ConceptHard
  8. Where does image decoding happen?ConceptMedium
  9. What happens in one frame of the event loop?ConceptMedium
  10. What does this trace's self time add up to?Predict the outputMedium
  11. Write a function that orders a server's responses by their RFC 9218 priorities.Write the codeHard

Budgets, monitoring & debugging slow pages

  1. What is a performance budget?ConceptEasy
  2. How do you catch performance regressions in CI?ConceptMedium
  3. How do you monitor performance in production and alert on it?ConceptMedium
  4. A page's LCP got worse last week: how do you find out why?ConceptHard
  5. Users say the app feels laggy: how do you debug INP?ConceptHard
  6. How do you A/B test a performance change?ConceptMedium
  7. How do you make the business case for performance work?ConceptMedium
  8. How do you test for low-end phones and slow networks?ConceptMedium
  9. Design a real user monitoring pipeline.ConceptHard
  10. Which budget lines does this build break?Predict the outputMedium
  11. Write an alert rule that fires when the daily p75 stays over a line for several days in a row.Write the codeEasy