Design a Data Table (Sort / Filter / Virtualize)
Problem statement
Design a high-performance data table with virtual scrolling for 100k rows, server-side sort and filter, multi-column sort, shift-click range selection, column resize, and CSV export.
Asked In
Key Challenges
- ·Rendering 100,000+ rows while maintaining 60fps scrolling (Virtualization/Windowing)
- ·Performant multi-column sorting and complex nested filtering on the client
- ·Column Management: Resizing, reordering, and visibility toggling without layout thrashing
- ·State Synchronization: URL-persistent state (filters/sorts) with back-button support
- ·Accessibility (WCAG 2.1): Keyboard navigation (arrow keys), ARIA grid roles, and screen reader announcements
- ·Real-time Updates: Handling live row updates/inserts without jumping the user's scroll position
- ·Cell Rendering Optimization: Avoiding O(N) re-renders when a single cell value changes
2-Minute Answer — High-Level TL;DR
Read this before your interview
HLD Interview Focus
First clarify total rows and who owns sorting, filtering, and pagination. For a bounded dataset loaded in full, client processing may be sufficient; expensive work can move to a worker. For large remote datasets, send sort/filter parameters to the server and paginate its results rather than sorting only the current page. Virtualize mounted rows when rendering cost warrants it. Preserve stable row IDs, URL query state, selection semantics, and keyboard focus. Virtualization reduces DOM cost but complicates find-in-page, variable heights, and focus.
My Approach: Building the Solution
How to think about this problem
Choose the data ownership and pagination contract, then separate query state and row identity from the rendered viewport. Measure before deciding on virtualization or worker processing.
Why This Approach?
Pagination limits fetched data; virtualization limits mounted nodes. Their costs and benefits are different. Server-side sorting must apply to the full matching dataset, and select-all needs a defined meaning across unloaded pages.
A table viewport is a viewfinder over a huge map. You never hold the whole map in your hands — you only mount the tiles in the lens, plus a thin border of overscan so fast pans do not flash empty. When someone asks "find row 48,291," you do the offset math yourself; the browser's Cmd+F will not help, because that row is not in the DOM.
Requirements: What Makes a Great Solution?
Clarify scope before designing anything
Requirements Exploration Questions
Ask your interviewer these questions to refine requirements
What is the data scale?
- ·Total rows (1k vs 1M)
- ·Data source (Full client-side load vs Lazy server-side fetch)
- ·Cell complexity (Text only vs interactive widgets/charts)
What are the core features?
- ·Multi-column sort and nested filter logic
- ·Column resizing and drag-and-drop reordering
- ·Row selection (Single/Multi/Shift-select)
- ·In-cell editing support
What are the layout constraints?
- ·Fixed headers and pinned columns (left/right)
- ·Variable row heights vs fixed height
- ·Responsive behavior (Horizontal scroll vs Stacked)
Functional Requirements
Must Have — MVP
- ✓Virtualized row rendering (Windowing)
- ✓Sortable column headers
- ✓Text-based filtering
- ✓Column visibility toggle
- ✓Sticky headers
- ✓Keyboard accessibility (Tab/Arrow keys)
Advanced (If Time Permits)
- +Multi-sort (Shift+Click headers)
- +Custom column filters (Date range, Multi-select)
- +Web Worker-based data processing
- +Resizable columns with persistent widths
- +Grouping and Aggregations (Footer totals)
- +Export to CSV/Excel
Non-Functional Requirements
Performance
- ·Scroll performance at 60fps (no jank)
- ·Initial render < 500ms for 50 columns
- ·Filter/Sort latency < 100ms for 10k rows
- ·Minimal memory footprint for large datasets
Reliability
- ·URL state persistence (Deep linking)
- ·Graceful error handling for corrupt data
- ·Recovery of scroll position on refresh
Accessibility
- ·ARIA Grid role compliance
- ·Focus management for interactive cells
- ·Screen reader announcements for sort/filter state changes
The full solution is part of HelloFrontend Pro
The question above is free to read in full. Upgrade to unlock the interactive workspace and the senior-level walkthrough that go with it.
- Full RADIO-framework walkthrough with architecture diagrams
- Data model, API design, and rendering strategy trade-offs
- Performance, accessibility, and offline sections plus a model answer
Already a member? Log in to open the workspace.