Design and implement a high-performance React virtualization component to render lists of 50,000+ items smoothly at 60fps.

Mark it off to log your completion progress, or bookmark it to review trade-offs later.
Join senior engineers who receive practical, deep-dive frontend challenges, detailed concepts, and blueprints directly in their inbox.
We value your privacy. Unsubscribe at any time.
When building dashboards, search grids, or real-time logs feeds, frontend applications often have to render tens of thousands of items. In traditional React development, calling .map() to output 50,000 records results in 50,000 DOM nodes. This creates massive memory overhead, degrades initial load time, and causes scroll stuttering due to continuous layout calculations (reflows).
Your task is to build a reusable, high-performance VirtualList component in React. Rather than rendering all elements, your component must calculate the user's current scroll position and render only the items that are currently visible within the visible container (plus a small buffer). As the user scrolls, the component should recycle elements dynamically, keeping the total DOM footprint tiny and rendering at a smooth 60fps.
items of length $N$, a visible viewport height, a fixed itemHeight (in pixels), and a renderItem function component.transform: translateY(...) or top) so they appear at their correct vertical positions within the virtual list wrapper.items: T[], renderItem: (item: T, index: number) => ReactNode).