useMemo caches a computed value between renders; useCallback caches a function reference. They are the same mechanism, since useCallback(fn, deps) is useMemo(() => fn, deps). Reach for them when a value is genuinely expensive to compute, or when a reference is a dependency of an effect or a prop to a memoized child. Skip both for cheap values, because the bookkeeping is not free.
Why interviewers ask this
Reflex memoization is one of the most common smells in React code, so the interviewer wants judgment rather than habit. They are checking that you understand referential identity, that you know memoizing a prop only helps when the child is itself memoized, and that you would reach for the profiler before sprinkling hooks. In 2026 they may also want to hear where the React Compiler removes the need entirely.
How to structure your answer
- State the one line difference: value versus function reference.
- Give the two cases where it actually pays off.
- Say what you measure before adding it.
- Mention the React Compiler and where manual memoization is heading.
Example answer
They are the same tool wearing different hats. useMemo caches a value, useCallback caches a function, and under the hood useCallback is just useMemo returning that function. I only reach for either for two reasons. One, the computation is genuinely expensive, like sorting and grouping a few thousand rows. Two, the identity of the thing matters, because it is a dependency of an effect or a prop going into a component wrapped in React.memo. If neither is true I leave it alone, because every memo call still costs a comparison and some memory, and it makes the code noisier to read. What I actually do first is open the React Profiler and check whether the re-render costs anything at all. Most of the time the real fix is not a memo, it is moving state closer to where it is used so half the tree stops rendering. And on newer projects with the React Compiler enabled, a lot of that manual memoization goes away, which I am happy about; the code reads better without it.
Walking into this interview soon? GhostPilot listens to your live call, spots the question the moment it is asked, and puts a structured answer on your screen in real time. Try it on your next mock, or grab a $29 Session Pass, no subscription, for the real thing.
See how it worksFollow-up questions to expect
- What does React.memo compare by default and how do you change that?
- Why does an inline object prop defeat React.memo?
- How would you memoize something that depends on a value from context?
Related react developer questions
Your interviewer will ask their own version of this. Paste your actual job description into the free Question Predictor and get the 20 questions that role is most likely to ask, with what each one is really probing.
Predict my questions