React Interview Questions

The React questions interviewers actually ask, from hooks and reconciliation to avoiding re-renders and server components — each with a short, correct answer. Then rehearse them in a live AI mock.

Practice these live with an AI interviewer
Get asked questions one at a time and a scored feedback report — free.

10 common React questions

What is the virtual DOM?

It's an in-memory representation of the UI. React diffs the new tree against the previous one (reconciliation) and applies only the minimal set of real DOM updates, which is faster than manual DOM manipulation.

What are hooks and what are the rules?

Hooks like useState and useEffect let function components use state and lifecycle features. Rules: only call them at the top level (not in loops/conditions) and only from components or other hooks.

useState versus useReducer — when to use each?

Use useState for simple, independent pieces of state. Reach for useReducer when state is complex, several values change together, or the next state depends on the previous — it centralizes the logic in a reducer.

What does useEffect do and when does it run?

It runs side effects after render. The dependency array controls timing: [] runs once on mount, [dep] runs when dep changes, and no array runs after every render. Return a cleanup function for teardown.

Why do list items need keys?

Keys give items a stable identity so React can tell which were added, removed, or reordered. Use stable unique IDs — not the array index, which causes subtle bugs when the list reorders or changes.

Controlled versus uncontrolled components?

In a controlled component the form value lives in React state (one source of truth); in an uncontrolled one the DOM holds the value and you read it with a ref. Controlled is preferred for validation and dynamic behavior.

What do useMemo and useCallback do?

useMemo caches a computed value and useCallback caches a function reference between renders. Use them to skip expensive recomputation or to keep stable props for memoized children — not everywhere, since they add overhead.

What causes unnecessary re-renders and how do you prevent them?

State or prop changes, new object/function references each render, and context updates. Mitigate with React.memo, useMemo/useCallback, splitting state, and lifting state only as high as needed.

What is prop drilling and how do you avoid it?

Prop drilling is passing props through many intermediate components that don't use them. Avoid it with the Context API, component composition, or a state manager like Zustand or Redux.

Server Components versus Client Components?

Server Components render on the server, ship no JavaScript, and can fetch data directly. Client Components ('use client') run in the browser for interactivity and state. Compose them to keep client-side JS small.

Ready to practice out loud?

Reading answers is one thing — saying them under pressure is another. Run a free AI mock interview and get scored feedback.

Start a mock interview

More interview questions