Interview prep

React Interview Questions

React interviews focus on rendering behaviour, state ownership and effects — plus performance debugging in senior loops.

Questions and answers

01What triggers a re-render in React?

State updates, context value changes and a parent re-rendering. Props changing does not itself trigger anything — the parent re-rendering does, and memoisation is how you cut that chain.

02When do you reach for useMemo or useCallback?

When a value is expensive to compute, or when a referentially stable value is required by a memoised child or a dependency array. Applying them everywhere adds cost without benefit.

03Explain the rules of hooks.

Hooks must be called unconditionally at the top level of a component or another hook, because React matches them by call order across renders.

04How do you handle data fetching in modern React?

Through a caching layer such as TanStack Query or a framework loader, rather than useEffect. That gives deduplication, caching, retries and consistent loading states.

05What causes hydration mismatches in SSR?

Rendering something on the server that differs on the client — dates, random values, or reads of localStorage and window during the first render. Move those reads into an effect.

How to answer these well

Interviewers are not grading recall — they are checking whether you've hit the failure mode the question describes. Anchor every answer to something you actually shipped or debugged with React.

Say the trade-off out loud. "I'd use X here, but it costs Y under Z conditions" scores higher than a clean textbook definition every time.

Roles asking for React

Related prep