React Developer interview question
Users report that a React app's memory keeps growing the longer they keep it open. How do you investigate?
Scenario Asked in Frontend Engineer · Full Stack Engineer interviews
Summary
Reproduce the usage pattern, take heap snapshots in Chrome DevTools before and after repeating it, and compare which objects keep growing (detached DOM nodes, listeners, closures holding large data). Common React causes are effects that subscribe without cleaning up, timers and intervals left running, caches that never evict, and global stores that keep everything ever loaded.
Keep reading with a membership
The full answer with examples, key points and comparisons is part of the membership, along with every other interview answer, progress tracking and Daily Review. Most-asked answers stay free to read.
More React Developer questions
- Explain React concept: state.
- Explain React concept: controlled vs uncontrolled inputs.
- Write a custom React hook that debounces a value, and use it to search an API without race conditions.
- Explain React concept: props.
- A React page with a long list becomes slow when typing in a search box. How do you find and fix the problem?
- Explain React concept: keys in lists.
- Explain React concept: JSX.
- Explain React concept: lifting state up.