Intermediate to senior

Frontend Interview Prep

Fourteen chapters on HTML and CSS, core JavaScript, the event loop, browser rendering, React, state, performance, accessibility, security, TypeScript, testing, machine-coding components and frontend system design, with tested code.

Chapter 1 of 14Foundations · How Frontend Interviews Work

How Frontend Interviews Work

Frontend interviews are broader than many people expect. You may be asked to build a UI component live, answer questions about the browser and JavaScript, debug a layout, write a utility function, and design a whole client-side system. This chapter maps the rounds, shows what each one checks, and gives a preparation plan you can follow before reading the rest of the track.

1. The rounds you will meet

RoundWhat it checksTypical prompts
JavaScript fundamentalsclosures, this, prototypes, scope, equality, coercion, modules"What does this snippet print?", "Explain closures."
Async and the event looppromises, async/await, microtasks versus macrotasks, race conditions"Order the logs.", "Implement Promise.all."
Utility codingsmall, precise functionsdebounce, throttle, deep clone, curry, memoise, event emitter, flatten
UI machine codingbuilding a component in 45 to 90 minutesautocomplete, star rating, accordion, modal, tabs, todo list, infinite scroll, data table
HTML/CSSlayout, specificity, responsive design, centring, positioning"Build this layout.", "Why is this element not centred?"
Framework knowledge (usually React)rendering, hooks, state, effects, keys, performance"Why does this effect run twice?", "When to use useMemo?"
Browser and performancerendering pipeline, Core Web Vitals, caching, bundling"Why is this page slow?"
Accessibility, security, testingsemantics, ARIA, XSS, CORS, unit and integration testing"How would you make this dropdown accessible?"
Frontend system designarchitecture of a real product"Design a news feed", "Design a collaborative editor UI."
Behaviouralcollaboration with design and backend, ownership, qualitystandard STAR questions (see the HR track)

Companies vary. Product startups lean toward machine coding and React; large companies add data structures and algorithms, plus system design; agencies emphasise CSS and accessibility.

2. What interviewers look for in a UI coding round

  1. Clarifying questions before typing: required features, edge cases, browser support, accessibility, data size.
  2. A plan: component breakdown, state shape, events.
  3. Working software first, then polish. Get a minimal version running in the first 20 minutes.
  4. Clean code: meaningful names, small functions, no duplication.
  5. Correctness at the edges: empty states, loading and error states, rapid clicks, long text, keyboard use.
  6. Semantics and accessibility: real buttons, labels, focus management, keyboard support.
  7. Communication: narrate trade-offs, not just keystrokes.

A good habit: after the basic version works, say "next I would handle loading and error states, keyboard navigation, and debouncing", then do as many as time allows.

3. The map of this track

ChapterUse it for
HTML, CSS and layoutsemantics, the box model, flexbox, grid, specificity, responsive design
JavaScript corescope, closures, this, prototypes, equality, modules
Async JavaScriptthe event loop, promises, async/await, cancellation
Utility functionsthe coding questions that come up again and again
Browser rendering and performancethe critical path, layout thrash, Core Web Vitals, bundles
React fundamentals and hooksrendering model, effects, keys, memoisation
State and data fetchingwhere state lives, caching server data, forms
Accessibilitysemantics, keyboard, ARIA, focus, testing
Web securityXSS, CSRF, CORS, CSP, token storage
TypeScripttypes that help, generics, narrowing
Frontend testingwhat to test and how
Frontend system designa framework and worked examples

4. A four-week plan

WeekFocusOutput
1JavaScript core and async; write the utility functions by hand15 snippets explained aloud, 10 utilities implemented
2HTML, CSS, layout, accessibility; rebuild three real page layoutsthree responsive pages, keyboard-checked
3React and state; build five components (autocomplete, modal, tabs, infinite list, form)working code with edge cases
4Performance, security, testing, system design; mock interviewstwo timed machine-coding rounds, one design walkthrough

Throughout, practise without autocomplete in a plain editor, and say your reasoning aloud.

5. Answering conceptual questions well

A reliable structure:

  1. Define it in one sentence.
  2. Show a tiny example.
  3. Say why it exists (the problem it solves).
  4. Name a pitfall or when not to use it.

For instance, "What is a closure?" A closure is a function together with the variables from the scope where it was created. function counter(){ let n = 0; return () => ++n; } keeps n alive. It lets you create private state and callbacks that remember context. The classic pitfall is capturing a loop variable declared with var, so every callback sees the final value.

6. Common mistakes

  • Coding immediately without clarifying.
  • Ignoring semantics: a div with a click handler instead of a button.
  • No keyboard path in a component.
  • Memorised answers with no ability to reason about a variation.
  • Premature optimisation (useMemo everywhere) with no measurement.
  • Not handling the empty, loading and error states.
  • Treating the framework as the whole of frontend, and not knowing the browser underneath.

7. Practice questions

  1. Describe the last UI component you built from scratch and its trade-offs.
  2. What happens between typing a URL and seeing a page?
  3. What are the differences between var, let and const?
  4. How would you build an accessible modal?
  5. Explain the event loop in two minutes with an example.
  6. How do you decide where state should live?
  7. What would you check first on a slow page?
Header Logo