Skip to content
RED SAGSkills
mediumFrontend Developer interview question

A React screen feels slow. How do you find and reduce unnecessary re-renders?

What the interviewer wants to hear

  • Measure first with the React DevTools Profiler and the browser Performance panel
  • Move state down closer to where it is used, or lift content up as children
  • Keep props stable with useMemo and useCallback and use React.memo where it pays off
  • Avoid new object or array values in context and split contexts
  • Consider the React Compiler, virtualization for long lists, and transitions for heavy updates

Model answer

I measure before changing anything. The React DevTools Profiler shows which components render, how often and why, and the Performance panel shows whether the cost is in rendering, layout or something else. Common fixes start with structure rather than memoization: I move state down to the component that needs it, so a typing field does not re-render the whole page, or pass heavy subtrees as children so they are not re-created. Next, I look at referential equality. Inline objects and functions passed to memoized children or as a context value break memoization, so I stabilise them with useMemo and useCallback, wrap expensive pure components in React.memo, and split large contexts. If the project uses the React Compiler, much of this memoization happens automatically. For long lists I use virtualization, and for heavy updates triggered by typing I use startTransition or useDeferredValue. I confirm each change with the profiler again.

Can you answer it under time pressure?

Take a timed medium round and get scored on every answer.

Start mock interview

More medium Frontend Developer questions