Skip to content
Sahil Durgia/ full-stack
2 min readInterview Prep

Top 25 React Interview Questions, Actually Explained (2026)

The capstone of the why-React series — every answer here traces back to the actual mechanism (closures, the virtual DOM, Server Components), not a memorized line.

Reactinterview questionsinterview prep

This is the capstone of the why-React series on this blog — every question below is answered in full, with the actual mechanism, in an earlier post. This is the condensed version, the kind of answer that survives a genuine follow-up question.

Core mechanics

  • What is the virtual DOM, and why does it exist? — A lightweight JS object tree, diffed against the previous one to compute minimal real DOM changes. It exists because real DOM writes are expensive, and 'describe the result, don't write the mutations' needs a cheap intermediate representation to diff against. Full breakdown in the virtual DOM post.
  • Why does a list need a key prop? — The diffing algorithm needs a stable identity per item to distinguish 'this moved' from 'this was deleted and a new one created'; without it, React falls back to position, which misattributes state across reorders.
  • What's the difference between props and state? — Props are passed in from a parent and are read-only from the child's perspective; state is owned and can be changed by the component itself, via useState or similar.
  • Why do hooks have rules (only call at the top level, only from React functions)? — React tracks hook state by call ORDER, not by name, across renders. A hook called conditionally can shift its position in that order between renders, misaligning which state slot React thinks it's reading — full mechanism in the hooks-from-first-principles post.

Architecture and state

  • When would you reach for Context vs Redux vs Zustand? — Context for infrequently-changing global state (theme, current user); Redux when global client state is genuinely complex and needs strict, predictable update patterns; Zustand for global state simpler than Redux's ceremony justifies. Full comparison, including where TanStack Query fits for server state specifically, in the state-management post.
  • What's a Server Component, and how is it different from a Client Component? — A Server Component runs only on the server, ships zero JS to the browser, and can't use hooks or browser APIs; a Client Component runs in the browser and can. The boundary is drawn once with 'use client' and doesn't propagate to children unless they also opt in.
  • Why does React batch state updates? — Multiple setState calls inside one event handler are grouped into a single re-render instead of one render per call — a direct application of the event-loop mechanism from the JavaScript fundamentals series: React defers the actual re-render until the current synchronous execution finishes.

What actually separates a strong answer here

The weak version of 'why does a list need a key' is 'React said so.' The strong version connects it to what the reconciliation algorithm is actually trying to figure out — which is exactly the kind of connection every post in the why-React series was built to make explicit, not just state as a fact to memorize.

Related case study
Amber Car Rental

A car rental agency needed to move off manual, phone-and-spreadsheet bookings to a real-time online platform — built and run solo.