Ctrl K
Frontend · Mid-level · Theory

A React component re-renders too often, and the UI is lagging. How would you find the cause, and how would you fix it?

~4 min by voice

How to approach it

They're checking whether you understand how re-renders work in React and can first measure the problem with tools and then fix it precisely — through component structure, memoization, splitting context — rather than blindly wrapping everything in memo.

Have you seen this question in a real interview?
Answers0
Avg. score—
Strong—
Practiced0
Topics
Similar questionsUsers complain that the page stutters and lags when they scroll. How would you look for the cause, and what role might reflow and repaint play here? Mid-levelWhat makes a React component re-render, and how do you avoid unnecessary re-renders? JuniorWhat happens in the browser between a change to the DOM or styles and pixels appearing on screen? How do you use that to keep animations and scrolling from janking? SeniorWhat's the fundamental difference between how React and Vue update the UI? How does that affect how you deal with unnecessary re-renders? Senior

Answer by voice

The interviewer will ask this question and listen. Think out loud and ask for a hint if you need one. When you're done, pause or tap “That's my answer”. In about a minute, your score and the points you covered show up here.

Sign in to answer

Best with headphones · ~4 min