hard35 min

Build a Virtualized List

Build a virtualized list that efficiently renders only the visible items in a scrollable container. Given a list of 10,000 items, only the items currently in the viewport (plus a small buffer) should be rendered as DOM elements. This tests your understanding of scroll calculations and performance optimization.

useStateuseRefuseCallbackscroll mathperformance
  • Renders only a small subset of 10,000 items
  • Shows correct items for current scroll position
  • Updates visible items on scroll
  • Container has correct total scrollable height
  • Items are positioned correctly using absolute positioning
Your Code
Loading editor...