React Curriculum

React Performance Optimization Interview Questions

React performance optimization interview questions reflect how high-scale frontend applications require rigorous performance engineering. Interviewers want to see that you measure before optimizing, rather than blindly sprinkling useMemo across your codebase.

Learn how component composition patterns eliminate re-renders without memoization, implement list virtualization for tens of thousands of items using mathematical windowing, and diagnose performance bottlenecks using the React DevTools Profiler flamegraph.

The lessons follow the order an interviewer usually probes: first why a component re-renders at all, then the fixes that need no memoization, such as moving state down and passing components as children, and only then React.memo with a custom comparator. Code splitting with React.lazy and Suspense covers the bundle, and list virtualization covers rendering only what is on screen.

The traps that cost candidates the round are covered too: memoizing a component whose props are new objects on every render, wrapping cheap work in useMemo, and claiming a speed-up without a Profiler recording to show it.

React Performance Optimization Interview Questions: 5 lessons

#01
React.memo & Custom Comparator Functions
MediumFree

React.memo is a higher-order component that skips re-rendering when props are shallowly equal (Object.is). You can pass a custom arePropsEqual(prevProps, nextProps) comparator, returning true to skip re-rendering or false to re-render.

#02
Re-render Optimization Without Memo
MediumFree

You can eliminate unnecessary component re-renders without using useMemo or React.memo by refactoring your component architecture: "Moving State Down" to isolate frequently updating state, and "Lifting Content Up" using children props to preserve element references.

#03
Code Splitting with React.lazy & Suspense
MediumFree

Lazy loading in React relies on code splitting, which breaks monolithic JavaScript bundles into smaller chunks loaded on demand. React.lazy enables dynamic import() of components, while <Suspense fallback={<Spinner />}> coordinates loading boundaries during network chunk resolution.

#04
List Virtualization & Windowing Strategies
HardFree

List virtualization (windowing) renders only the subset of items currently visible in the browser viewport (plus a small overscan buffer), recycling DOM nodes as the user scrolls. It keeps DOM node counts constant (e.g. 20 elements) even for lists of 100,000 items.

#05
React DevTools Profiler: Flamegraph Analysis
HardFree

The React DevTools Profiler records render passes to diagnose performance bottlenecks. The Flamegraph view shows component tree render durations (width = duration, color = cost), while the "Why did this render?" setting pinpoints specific prop or state changes.

Frequently asked questions

When should you use React.memo?

When a component re-renders often with the same props and its render is measurably expensive. It compares props shallowly, so it only helps if the parent passes stable values: primitives, or callbacks and objects kept stable with useCallback and useMemo. Measure with the React DevTools Profiler first; memoizing a cheap component only adds a comparison.

How do you stop unnecessary re-renders without React.memo or useMemo?

Move state down into the component that uses it, or lift the expensive part up and pass it in as children. A child passed as children is created by the component above, so it does not re-render when the state of the component wrapping it changes.

What is list virtualization in React?

Rendering only the rows visible in the scroll viewport plus a small buffer, positioned inside a container sized for the whole list. A list of 10,000 items then mounts a few dozen DOM nodes, which keeps the first render and scrolling fast. Libraries such as react-window and TanStack Virtual implement it.