A virtualized grid presents one large logical table while mounting only the cells near the viewport. Correctness comes from two shared geometry indexes, one scroll owner, and a logical focus and selection model that does not depend on recycled DOM nodes.
A virtual list answers one spatial question: which rows intersect the viewport? A grid adds a second axis and several coupled surfaces. The body scrolls horizontally and vertically. Column headers follow horizontal movement. Row headers follow vertical movement. A frozen corner follows neither. Column resizing changes every offset to its right, and keyboard movement may target a cell that is not mounted yet.
The clean mental model is one coordinate plane, not four independent tables. Stable row and column IDs identify data. Row and column size indexes map logical coordinates to pixels. Every rendered region projects from those same indexes.
Start with the product contract
Ask whether the product is a read-only table, an interactive data grid, or a spreadsheet-like editor. That choice changes semantics and keyboard behavior. A native HTML table is often the best answer for modest, mostly read-only data. Virtualization becomes reasonable only after retained DOM, rendering, or memory exceeds a measured target.
For this interview, assume 100,000 logical rows, 200 columns, variable row heights, resizable columns, one frozen header row, two frozen columns, range selection, keyboard navigation, copy and paste, and a mid-range mobile target. These figures are explicit design assumptions.
The public interview prompt
Design a virtualized grid for a large operational dataset. Explain:
- stable row and column identity, size indexes, and two-axis range lookup;
- one scroll owner, frozen headers and columns, and layer synchronization;
- variable sizes, ResizeObserver batching, column resize, and anchoring;
- keyboard navigation, focus modes, editing, selection, and reveal;
- logical copy and paste, validation, permissions, and transaction boundaries;
- ARIA grid semantics, row and column counts, logical indices, and screen-reader testing;
- server rendering, restoration, loading, errors, printing, export, and browser Find;
- performance budgets, observability, testing, rollout, and simpler fallbacks.
Keep formula calculation, collaborative spreadsheet editing, pivoting, and server-side query planning out of version one. They deserve separate designs.
What the premium solution covers
The full solution develops the two geometry indexes, visible rectangle, frozen-region projection, resize transaction, logical focus and selection state, clipboard pipeline, accessibility contract, and server boundary. It also covers variable tracks, programmatic reveal, editing, restoration, degraded modes, security, performance, observability, and interview scoring.
Original media follows a keyboard target across both window boundaries, maps the four rendered regions, traces shared geometry, and turns a logical range into a validated clipboard transaction. Two deterministic labs expose the range arithmetic and horizontal anchor correction.