React Interview Questions and Answers

React interviews start with how components render and re-render: props versus state, keys, the virtual DOM and reconciliation, and what actually triggers an update. Interviewers then push into hooks (useState, useEffect, useMemo, useCallback, useRef), their rules, and the bugs they cause: stale closures, missing dependencies and effect loops.

Senior rounds move to design: state management trade-offs (context versus a store), data fetching and caching, code splitting, memoisation that really helps, accessibility and testing. Each question below has a worked answer with a short code example, so you can explain the why and not only the what.

Questions

Related

Frequently asked questions

What React topics are asked most in interviews?

Hooks and their pitfalls, how rendering and reconciliation work, state management (lifting state, context, stores), performance (memoisation, lists, code splitting) and testing components.

How do I prepare for a React interview?

Build one small app that uses every common hook, then read the answers here and explain each one out loud. Practise spotting a stale closure or an unnecessary re-render in a code snippet.

Are class components still asked?

Occasionally, mostly to compare the lifecycle with hooks. Focus on function components, but know how componentDidMount, componentDidUpdate and componentWillUnmount map to useEffect.