Back to Get Hired
Interview roundNail the interview11 min read

The frontend interview: React, CSS, and the browser

A frontend interview isn't one test, it's four or five small ones. Here's every round you'll actually face, the fundamentals they quietly probe, and how to talk through a live UI build without freezing.

On this page

A frontend interview is several small interviews

Who this is for

Anyone interviewing for a frontend or full-stack role who can build things but isn't sure what the rounds are testing. Especially career switchers and new grads who've shipped projects but never had someone grill them on the event loop or watch them write CSS live.

People prep for "the frontend interview" like it's one thing. It isn't. It's a *bundle* of small evaluations, and each one is looking for a different signal. If you walk in expecting a single coding test, the UI-build round blindsides you. If you only practise building components, the "how does the browser work" round catches you flat. Knowing the shape of the day is half the battle.

The rounds vary by company, but they're drawn from the same small deck. Most loops pick four or five of these. Almost none skip the live UI build, that one is the heart of a frontend interview.

  • UI build / component challenge — build a working thing in the browser, live, while they watch.
  • JavaScript fundamentals — closures, the event loop, promises, this, sometimes implementing debounce or a tiny event emitter from scratch.
  • CSS and layout — center this, make this responsive, why is this element overflowing, explain the box model.
  • "How the browser works" — what happens between typing a URL and seeing pixels, the DOM, reflow vs repaint, the render path.
  • DSA-lite — a lighter algorithms round than backend roles get. Arrays, strings, maybe a tree because the DOM is a tree. Rarely dynamic programming.
  • Frontend system design — "design an autocomplete", "design an image carousel", "design a data table that handles 10k rows." Components, state, data flow, performance, not load balancers.
Backend interviews ask "can you reason about systems?" Frontend interviews ask "can you build something a human will actually use, and explain why it behaves the way it does?"

The rounds, what each one assesses, and how to prep

Each round is fishing for a specific signal. Once you know the signal, prep gets focused. You stop grinding 300 algorithm problems for an interview that has one easy array question and four rounds about the browser.

RoundWhat they're really assessingHow to prep
Live UI buildCan you turn a spec into working UI under mild pressure, and narrate your thinking? Do you handle loading, error, empty states?Build small components on a timer. Practise out loud. Always ship something working before polishing.
JavaScript fundamentalsDo you understand the language, not just React? Closures, async, this, scope.Be able to explain the event loop and implement debounce, throttle, a promise-based delay, a simple emitter.
CSS and layoutCan you lay things out without trial-and-error? Do you reach for flexbox and grid deliberately?Drill: center a box, equal-height columns, a responsive card grid, sticky header. Know the box model cold.
How the browser worksDo you know what's happening under the framework? Render path, reflow/repaint, what blocks rendering.Walk the path: DNS, request, HTML parse, DOM/CSSOM, render tree, layout, paint. Know reflow triggers.
DSA-liteBaseline problem-solving. Usually one easy/medium array, string, or tree question.Light practice on arrays, strings, hash maps, basic tree traversal. Don't over-invest here.
Frontend system designCan you decompose a feature into components, model state, and reason about performance and edge cases?Practise designing autocomplete, infinite scroll, a carousel out loud: components, state, data flow, a11y, perf.
A typical loop picks four or five of these. The live UI build is almost always one of them.

The fundamentals they quietly probe

These come up everywhere, woven into other rounds. An interviewer building autocomplete with you will casually ask "why wrap the handler in a closure here?" or "this fires on every keystroke, what's the cost?" They're checking the foundation under the framework. React sits on JavaScript, JavaScript sits on the browser. They want to see you understand the layers below the one you usually work in.

  • Closures — a function remembering the scope it was defined in. The basis of useState, event handlers that capture values, and most "why is this variable stale?" bugs.
  • The event loop — why JavaScript is single-threaded but non-blocking. Call stack, task queue, microtasks. Why a Promise.then runs before a setTimeout(0).
  • Promises and async/await — what a promise actually is, how await pauses, error handling with try/catch, why Promise.all beats awaiting in a loop.
  • `this` — how it's set by call site, the difference between regular and arrow functions, why arrow functions fixed a whole class of this bugs.
  • The DOM — it's a tree, not the HTML you wrote. How the framework builds and updates it for you, and what a "DOM node" actually is.
  • Reflow vs repaint — reflow recalculates layout (expensive), repaint redraws pixels (cheaper). Why reading offsetHeight in a loop tanks performance.
  • Accessibility and semantic HTML — a <button> is not a <div onClick>. Keyboard focus, labels, roles, why semantics give you behavior and a11y for free.

Don't memorize, be able to derive

Interviewers can tell rehearsed definitions from real understanding. Instead of memorizing "the event loop has a microtask queue," be able to trace what logs first in a snippet with a setTimeout, a Promise.then, and a plain console.log. If you can walk the trace, you understand it.

React-specific signals

If the role is React, the interview probes whether you understand the model, not just the syntax. Plenty of people can wire up useState. Fewer can explain *why* a component re-rendered, or when reaching for a library is the wrong move.

  • State vs props — props come from the parent and are read-only; state is owned by the component and triggers a re-render when it changes. Knowing where a piece of data should *live* is half of React design.
  • Reconciliation — when state changes, React re-renders and diffs the new tree against the old one, updating only what changed. This is why key matters in lists: it tells React which item is which.
  • Rules of hooks — call them at the top level, in the same order, every render. Not in conditions or loops. Understand *why*: React tracks hooks by call order, not by name.
  • When NOT to reach for a library — a toggle doesn't need a state manager. A two-field form doesn't need React Hook Form. Knowing when the platform or a few lines of useState is enough is a senior signal.

"I'd just add a library" can be a red flag

Reaching for a dependency before understanding the problem reads as junior. The strong move is to solve it with the platform first, then say "if this grew to X, I'd pull in Y, and here's the trade-off." Show judgment, not just package awareness.

The live UI build: how to talk while you build

This is the round people dread, and the one that matters most. You'll get a prompt like "build a star rating component" or "build a search box that filters this list," a blank editor, and someone watching. The trap is going silent and coding head-down. They aren't grading the final pixels as much as *how you work*. Narrate, and a stumble becomes a thinking-out-loud moment instead of a frozen screen.

  1. 1

    Clarify before you type

    Restate the task and ask two or three sharp questions. "Single or multi-select? Should it be keyboard accessible? Is the data already here or do I fetch it?" This buys thinking time and shows you scope before you build.

  2. 2

    Say the plan out loud

    "I'll start with the markup, then local state for the selection, then wire the click handler, then handle the keyboard and empty states." Now they know your path and can nudge you if you're heading somewhere they don't want.

  3. 3

    Ship the dumbest working version first

    Get something on screen that does the core thing, even if it's ugly and hardcoded. A working skeleton beats a half-built perfect plan. It also de-risks the round: if time runs out, you have a working thing.

  4. 4

    Narrate as you go

    "I'm lifting this into state so the parent can read it... I'll use a button here, not a div, so I get focus and Enter for free." Every sentence is a signal. Silence is the enemy.

  5. 5

    Refine in passes

    Now layer in the things that separate strong from average: loading, error, and empty states; accessibility; an edge case or two. Call each one out: "Let me handle the empty case, what should this show with zero results?"

  6. 6

    Sweep the edges out loud

    Before you say you're done, narrate the edges: "What if the list is empty? What if the fetch fails? Is this reachable by keyboard? Let me check the a11y quickly." Naming the gaps, even unfixed, scores higher than pretending they aren't there.

Pro tip

Loading, error, and empty are the three states juniors forget. Building all three unprompted, on a list or a fetch, is one of the clearest "this person has shipped real UI" signals you can send.

Common failures, and how to talk through a component

Most live-build rounds are lost the same handful of ways. None are about not knowing enough. They're about *how* you spend the time and what you forget under mild pressure.

  • Over-engineering — reaching for context, a reducer, and a custom hook to render a toggle. Solve the problem in front of you; mention scaling as a follow-up, don't build for it.
  • Ignoring accessibility<div onClick> instead of <button>, no labels, no keyboard support. A frontend role that ignores a11y is a tell, and it's easy to fix by reaching for semantic HTML first.
  • No loading / error / empty states — wiring the happy path and stopping. Real UI spends most of its life in one of the other three states.
  • Going silent — coding head-down so the interviewer can't follow your reasoning. Even a wrong turn, narrated, scores better than a correct one in silence.

Building in silence

(types for two minutes without speaking) ...okay, I think it works. (clicks around) Yeah, that's it.

Narrating the same build

I'll use a button for each star so I get keyboard focus and Enter for free, rather than a div with an onClick. The selected rating lives in state here in the parent, since the parent needs to read it. I'll wire the click to set that state... and let me add a hover preview so it feels responsive. Quick check on the edges: zero stars should be a valid state, and I want this reachable by keyboard, so let me make sure tab order is sane. If this needed half-star ratings later I'd switch to tracking a number instead of an index, but for the spec, this is enough.

  • Names the semantic-HTML choice (button over div) and *why*, which doubles as an accessibility signal.
  • States where data lives and why, showing real React reasoning instead of just wiring it up.
  • Sweeps edge cases out loud (zero state, keyboard order) instead of hoping they don't get asked.
  • Mentions the scaling path (half-stars) without building it, showing judgment about over-engineering.

Walking in

  • Know the shape of the day: it's four or five small rounds, not one test.
  • The fundamentals live under the framework, be ready to trace the event loop and explain closures.
  • For React, explain *why* something re-rendered and when a library is the wrong call.
  • In the live build: clarify, plan out loud, ship the dumb version, then refine in passes.
  • Build loading, error, and empty states unprompted, it's the clearest "I've shipped real UI" signal.
  • Narrate everything. A stumble out loud beats a correct answer in silence.

Reading is step one. Now do it for real.

When you're ready, the platform has live mock interviews and portfolio-grade capstone projects you can actually talk about.

This is general, educational career guidance, not legal, financial, immigration, or professional advice. Examples are illustrative and simplified. Norms vary widely by country, company, role, and over time, so always verify what applies to your own situation. Nothing here guarantees an interview, an offer, or any particular outcome.