All jobs / Frontend / web developer
Frontend / web developer interview question · 1–3 years
When does React.memo help, and when does it not?
The strongest answer
It skips re-rendering a component when its props are shallowly equal — helpful for expensive components receiving stable props; useless when a prop is a new object or function every render, or when the component is cheap
Why it works
Right. Shallow prop comparison; new references defeat it.
What a good answer covers
- memo skips renders on equal props.
- Shallow comparison.
- Stable props or it is wasted.
- Expensive components only.
Answers that fall short
- Close, but not the strongest: It always helps
Comparison has a cost. - Weak: It replaces useMemo
Different tool: memo is for components. - Red flag: It prevents state updates
State inside still re-renders it.
Who gets asked this
More Frontend / web developer questions
- The register API can fail because the email is taken or because the password is too short. What should the UI…
- The app feels sluggish when typing in one field. How do you find the cause?
- Where should state live, as a rule?
- Why do teams use a server-state library instead of useEffect plus useState for data?
- Choosing between client rendering, server rendering, static generation and streaming for a new product — how…
- A 400-component app has become impossible to change safely. What structural move do you make first?
- Different screens show different values for the same entity. What is the root cause and the design fix?
- Performance regresses every quarter despite fixes. How do you make it stick?