What they're testing
Whether you measure before optimising, and whether you know why a lone useCallback usually does nothing.
The short answer~30 seconds
memo helps when a component re-renders often with IDENTICAL props and rendering it is expensive. useMemo helps when a computation is genuinely expensive, or when you need a stable reference so a memoised child below actually benefits. useCallback only means something when the function goes into a memoised component or a dependency array — wrapping a function passed to an ordinary component is pure overhead.
The long answer
The thing you need in order to use it correctly: memo compares props with Object.is, field by field. So if you pass an inline object or array (style={{…}}, items={[…]}), the reference is new every render and memo never blocks anything. Which is why a great many memos in real codebases do nothing at all, and nobody notices because nobody measured.
The cost of memoisation is real too: each useMemo retains the previous value, compares a dependency array every render, and adds a line to read. For a cheap computation the comparison can cost more than the computation. Which is why react.dev states plainly that it's a performance optimisation and not a default — and the better fix is usually restructuring the component rather than adding wrappers.
The most effective restructuring I know is pushing state DOWN to where it's used, or passing children instead of rendering inline. A parent holding keystroke state re-renders its whole subtree per character; extracting the input into its own component leaves the rest untouched and needs no memo at all. React Compiler (React 19) automates much of this, so knowing the principle is more useful than knowing the syntax.
What they'll ask next
?Does React Compiler make these three redundant?
Largely, for code that follows the Rules of React — it inserts memoisation where needed. But it can only do that when components are pure, so understanding why re-renders happen still matters, and code with side effects during render still breaks.
These lose points
- Wrapping every function in
useCallback. If the receiving component isn't memoised, you've only added cost. - Optimising without opening the React Profiler. The first question has to be "what is re-rendering and why".