Interview questions
React Interview Questions
20 React interview questions with model answers: hooks, state, keys, React 19, Server Components, performance and React Native. For both sides.

What's here
20 React interview questions, grouped into 4 areas: react fundamentals, hooks, state, data and modern react and performance, testing and react native. Each one comes with why it is worth asking and what a strong answer contains, so the same question can be scored the same way by different interviewers.
- Ask candidates to build or extend a small component live; how they structure state tells you more than definitions.
- Probe useEffect with a scenario (a subscription, a fetch with a changing ID) rather than asking for the definition.
- Check whether the candidate knows React 19 and React Compiler, but do not mark down someone whose current job uses an older version.
Cohesyve finds, contacts and tests React candidates on the real work, then ranks them for these interviews. 14-day free trial for 10 candidates, not charged until it ends.
Preparing for this interview yourself? Practise it free →These React interview questions cover what front-end and full-stack interviews test in React JS today: components, props and state, the rules of hooks, data fetching, React 19 features such as Actions and Server Components, performance and testing, plus the differences in React Native. Candidates can treat the 'what to look for' notes as model answers; interviewers can use them to score answers and decide where to probe further.
React Fundamentals
The core model of components, props, state and rendering that every React developer should explain without hesitation.
- 1
What is a React component, and what does it mean that React is declarative?
Why ask it
Checks the mental model before anything else.What to look for
A component is a function that returns JSX describing the UI for given props and state. Declarative means you describe what the UI should look like for a state and React works out the DOM updates. Good answers mention composition: building screens from small components. - 2
What is the difference between props and state?
Why ask it
The most basic distinction in React, and weak answers are a warning sign.What to look for
Props are inputs passed from a parent and are read-only inside the component. State is data a component owns and changes over time through its setter, which triggers a re-render. State should be treated as immutable: create new objects or arrays instead of mutating them. - 3
Why does React need a key on list items, and why is the array index often a bad key?
Why ask it
Key bugs cause confusing UI behaviour that many developers cannot explain.What to look for
Keys tell React which item is which between renders so it can keep state and DOM nodes attached to the right item. Index keys break when items are inserted, removed or reordered, so state (such as an input's text) ends up on the wrong row. Use a stable unique ID. - 4
What is the difference between controlled and uncontrolled inputs?
Why ask it
Forms are everyday React work.What to look for
Controlled inputs take their value from state and update it through onChange, so React is the source of truth. Uncontrolled inputs keep their own value in the DOM, read through a ref or form data. Up-to-date candidates mention React 19 form Actions, where uncontrolled forms reset automatically after a successful submission. - 5
What causes a component to re-render?
Why ask it
Understanding re-renders is the basis of all React performance work.What to look for
A state change in the component, a re-render of its parent, or a change in a context it reads. Rendering means calling the component function; React then commits only the DOM changes that are needed. A re-render is not automatically a performance problem.
Before the React interviews, see who can do the work
Cohesyve finds and contacts React candidates from your job description and tests each one on an AI job simulation of the role, so these questions go to a ranked shortlist. 14-day free trial for 10 candidates, not charged until it ends.
Hooks
Hooks are where most React bugs live. These questions test whether the candidate understands why the rules exist.
- 6
What are the rules of hooks, and why do they exist?
Why ask it
Breaking them causes bugs that are hard to trace.What to look for
Call hooks only at the top level of a function component or custom hook: not inside conditions, loops, event handlers, try/catch blocks or after an early return. React relies on hooks being called in the same order on every render to match state to each call. The eslint-plugin-react-hooks plugin catches violations. - 7
Explain useEffect: when it runs, what the dependency array does and why cleanup matters.
Why ask it
Effects are the most misused hook.What to look for
Effects synchronise a component with something outside React (subscriptions, timers, network, the DOM) and run after render. The dependency array controls when they re-run; cleanup runs before the next run and on unmount to avoid leaks and race conditions. Strong candidates say many effects are unnecessary: derived values should be calculated during render. - 8
When would you use useMemo, useCallback or React.memo? Does React Compiler change the answer?
Why ask it
Tests performance judgement and whether the candidate is current.What to look for
They cache expensive calculations, keep function identities stable and skip re-rendering unchanged children. Use them when profiling shows a problem, not everywhere. Current candidates know React Compiler reached a stable 1.0 release in October 2025 and memoises components and hooks automatically at build time, which reduces the need for manual memoisation. - 9
What is useRef for?
Why ask it
Shows understanding of values that should not trigger renders.What to look for
A ref holds a mutable value that persists across renders without causing a re-render: DOM elements, timer IDs, previous values. Reading or writing ref.current during render is discouraged. In React 19, function components receive ref as a normal prop, so forwardRef is no longer needed for new components. - 10
How do you write a custom hook, and what makes a good one?
Why ask it
Custom hooks are how React teams share logic.What to look for
A function whose name starts with 'use' and that calls other hooks to package stateful logic, such as useDebounce or useWindowWidth. Each component calling it gets its own state. Good hooks have a focused purpose and a clear return value.
State, Data and Modern React
Architecture decisions and the features added in React 19.
- 11
How do you decide where a piece of state should live?
Why ask it
Poor state placement is the root of most messy React codebases.What to look for
Keep state as close as possible to where it is used, lift it to the closest common parent when siblings need it, use context for values many components read, and reach for an external store only for complex shared client state. Server data is often better handled by a data-fetching library or framework than by hand-rolled state. - 12
What is Context, and when is it the wrong tool?
Why ask it
Context is often overused as a global store.What to look for
Context passes values down the tree without prop drilling: theme, current user, locale. Every consumer re-renders when the value changes, so it is a poor fit for values that change frequently. Candidates may mention that React 19 lets you render the context itself as the provider. - 13
How do you fetch data in a React app, and what are the pitfalls?
Why ask it
Data fetching is where effects, state and UX meet.What to look for
Handle loading, error and empty states; avoid race conditions by ignoring or aborting stale requests in cleanup; cache and deduplicate requests, often with a library or framework loader. Strong answers mention Suspense and the React 19 'use' API for reading promises. - 14
What are React Server Components and Server Functions?
Why ask it
These are stable in React 19 and used by major frameworks.What to look for
Server Components render on the server (at build or request time) and send no component JavaScript to the client, so they can read data directly. There is no directive for Server Components; 'use client' marks the client boundary, and 'use server' marks server functions that client code can call. Good candidates know what cannot run in a Server Component, such as state and effects. - 15
Which React 19 features would you use in day-to-day work?
Why ask it
Shows whether the candidate has kept up.What to look for
Actions for async transitions with pending and error handling; useActionState and useFormStatus for forms; useOptimistic for instant UI feedback; 'use' for promises and context; ref as a prop; title and meta tags rendered from components. Credible answers explain one feature they have actually used.
Performance, Testing and React Native
Practical engineering questions for mid-level and senior candidates.
- 16
A list of several thousand rows feels slow. How would you diagnose and fix it?
Why ask it
Tests a measured approach to performance.What to look for
Profile first with React DevTools to find what renders and why. Then virtualise the list so only visible rows render, check keys, move expensive work out of render, memoise row components where it helps, and paginate or filter on the server if the data is large. - 17
How do you test React components?
Why ask it
Testing habits predict code quality.What to look for
Test behaviour the way a user sees it, for example with React Testing Library: render, interact, assert on visible output. Mock network calls, avoid testing implementation details such as internal state, and add end-to-end tests for critical flows. - 18
What is an error boundary, and what does it not catch?
Why ask it
Shows awareness of failure handling in the UI.What to look for
A component that catches errors thrown while rendering its children and shows a fallback instead of crashing the whole app. It does not catch errors in event handlers or asynchronous code, which need their own handling. React 19 adds root options to report caught and uncaught errors. - 19
How does React Native differ from React for the web?
Why ask it
Many React roles include some React Native work.What to look for
The component model and hooks are the same, but there is no DOM. Core components such as View, Text, Image, ScrollView and TextInput map to native platform views (for example View to UIView on iOS and ViewGroup on Android). Styling uses JavaScript objects with flexbox, and navigation, permissions and builds work differently. - 20
Build a search box that calls an API as the user types. What do you need to handle?
Why ask it
A realistic task that combines state, effects and UX.What to look for
Controlled input state, debouncing so not every keystroke sends a request, cancelling or ignoring stale responses, loading and error states, an empty-results message, and accessible labels and keyboard support. useDeferredValue or a data-fetching library are valid alternatives to hand-rolled debouncing.
Running the interview well
- 1Ask candidates to build or extend a small component live; how they structure state tells you more than definitions.
- 2Probe useEffect with a scenario (a subscription, a fetch with a changing ID) rather than asking for the definition.
- 3Check whether the candidate knows React 19 and React Compiler, but do not mark down someone whose current job uses an older version.
- 4Show a short component with a key or stale-closure bug and ask what goes wrong.
- 5For senior roles, discuss state architecture, performance trade-offs and how they review other people's React code.
- 6If the role includes React Native, ask at least one mobile-specific question about navigation, platform differences or builds.
Common questions
What React topics are asked most in interviews?
Props versus state, hooks (especially useState and useEffect), keys, re-rendering, lifting state, context, data fetching, performance and testing. Newer interviews add React 19 features and Server Components.
How should I prepare for a React JS interview?
Build a small app with forms, data fetching and routing, then practise explaining each decision. Be ready to write a component live, debug an effect and talk about performance. Read the official React documentation on hooks and effects, since many questions come straight from those concepts.
Do React interviews test JavaScript too?
Almost always. Expect questions on closures, 'this', promises and async/await, array methods, and immutability, because React code depends on them.
Are React Native interview questions different?
The React core is the same, but React Native interviews add native core components, styling with flexbox, navigation, platform differences between iOS and Android, performance on devices, and building and releasing apps.
Do I still need to know class components?
New code uses function components and hooks. You may still meet class components in older codebases, and error boundaries are written as classes, so be able to read one and explain lifecycle methods at a basic level.
What is React Compiler?
A build-time tool from the React team that automatically memoises components and hooks, reducing the need for manual useMemo, useCallback and React.memo. Its first stable release, 1.0, came out in October 2025.
Save these questions for the React candidates who can do the work
Cohesyve takes your React job description, finds candidates, reaches out to them and runs an AI job simulation of the real work, then returns a ranked shortlist.
1,500+
assessments completed
50%
faster time-to-hire
5 min
from JD to assessment
14-day free trial · 10 candidates · Not charged until the trial ends
Preparing for a React interview yourself? Practise on an AI job simulation of the role. 3-day free trial, cancel anytime.
From the blog