React interview questions
100 Frontend Engineering practice questions. Read what a strong answer covers, then practise it out loud against the clock.
Practise React questionsBeginner
- "Each child in a list should have a unique key" warning
- A component has grown to 800 lines
- A form submits twice when the button is clicked quickly
- A useEffect causes an infinite loop
- Building a show/hide toggle
- Building a simple form with validation
- Components in React
- Composition and the children prop
- Conditional rendering
- Context and useContext
- Controlled vs uncontrolled inputs
- Fetching data when a component loads
- Focusing an input when a modal opens
- Handling events in React
- Lifting state up
- Passing props through many layers
- Props in React
- Props vs state
- React fragments
- React Strict Mode
- Rendering lists and the key prop
- State and the useState hook
- State seems not to update immediately after setState
- Storing values that could be calculated
- The rules of hooks
- The useEffect hook
- The useRef hook
- The virtual DOM and reconciliation
- Updating an object in state doesn't re-render
- Ways to style React components
- What JSX is
- What React is and why it is popular
- What triggers a re-render in React
- Why components should be pure
Intermediate
- A component with many chained effects
- A large list makes typing in a search box slow
- Automatic batching of state updates
- Building a debounced search input
- Building an accessible modal in React
- Building infinite scrolling for a feed
- Code splitting with React.lazy
- Compound components pattern
- Context changes cause the whole app to re-render
- Custom hooks
- Designing a reusable Button component
- Effect dependencies and stale closures
- Error boundaries
- Finding why a component re-renders too often
- Hydration mismatch errors
- Implementing a dark mode toggle
- Input values jump between list items after deleting one
- Integrating a non-React library like a chart or map
- Keeping filter state in the URL
- Making a like button feel instant
- Passing refs to custom components
- Portals
- React.memo
- Render props and higher-order components
- Search results show data from an older query
- Suspense
- The initial JavaScript bundle is too large
- useMemo and useCallback
- useReducer
- useTransition and useDeferredValue
- Using keys to reset component state
- Warning about updating state on an unmounted component or leaking subscriptions
- When you don't need an effect
Experienced
- A complex dashboard becomes sluggish with real-time updates
- Adding multiple languages to a large React app
- Adopting the React Compiler in an existing codebase
- An unreliable React codebase with few tests
- Architecting a very large multi-step form
- Building a component library used across many apps
- Choosing a state management approach for a growing app
- Concurrent rendering in React
- Defining an error handling strategy for a React app
- Handling concurrent edits in a collaborative React UI
- How React preserves and resets state by tree position
- Memory usage grows the longer users keep the app open
- Modernising a codebase full of class components
- Moving an existing app to Server Components
- Protecting routes and handling session expiry in a React SPA
- React Fiber architecture
- React Server Components
- React's reconciliation heuristics
- Rendering strategies: CSR, SSR, SSG, ISR and islands
- Rolling out a major UI redesign safely
- Route changes in a single-page app aren't announced to screen readers
- Running multiple React apps on one page
- Server Functions and form actions
- Server rendering response times are too slow
- State colocation and component architecture
- Streaming server rendering with Suspense
- Syncing logout and cart state across browser tabs in a React app
- The React Compiler
- The use API in React 19
- Typing in one field re-renders a whole complex form
- Upgrading a large app to a new major React version
- useSyncExternalStore
- Virtualising a list with variable row heights