All jobs / Frontend / web developer / Performance
Frontend / web developer interview question · 3–5 years
Ten thousand rows in a div and the tab dies. What do you do?
The strongest answer
Window or virtualize the list (and recycle rows); don't mount ten thousand DOM nodes — paginate if the UX allows
Why it works
DOM count is the budget. Virtualization on web and FlashList / recycling on native are the same idea.
What a good answer covers
- Don't mount what you can't see.
- Virtualize or paginate.
- Recycle row components.
- Measure memory and INP after.
Answers that fall short
- Close, but not the strongest: Paginate only and skip the idea of virtualization
Pagination is a valid UX; they also want to hear you know windowing. - Weak: Add CSS contain and hope
contain helps paint, not 10k nodes. - Red flag: Create an iframe per row
Iframes multiply the cost.
Who gets asked this
More Performance questions
- A feature flag flips the hero after hydrate (flicker). How do you prevent it?
- An SSR page waits for user, then cart, then recommendations, sequentially. What's the issue and the fix?
- A content site with a few interactive widgets — full CSR SPA or islands / edge?
- Personalized HTML at the edge versus cache hit ratio — how do you decide?
- How does a frontend platform prove it is not making products slower?
- Images pop the page down as they load. What do you set and why?
- The main bundle includes an admin charts page most visitors never open. What do you do?
- When would you render a marketing homepage on the server versus a settings screen on the client?