A browser spreadsheet is a document engine with a grid interface. The hard part is not drawing cells. It is keeping formulas, ranges, clipboard commands, history, and a virtualized viewport attached to the same logical workbook revision.
A small editable grid can store values in a two-dimensional array. That model breaks when a row is inserted, a formula references another sheet, a paste changes ten thousand cells, or a worker finishes an old calculation after the user has already typed again.
The design needs two kinds of truth. Canonical workbook state records raw cell input, structure, and revisions. Derived state records calculated values, dependency indexes, layout measurements, and the current render window. Derived state may be rebuilt. Canonical state must never depend on which cells happen to be mounted.
Clarify the spreadsheet product
Ask about workbook size, formula compatibility, imports, exports, collaboration, offline work, data types, protected ranges, charts, macros, and audit requirements. A product that only edits a 50 by 20 planning sheet needs a much smaller design than a browser replacement for Excel.
For this interview, assume multiple sheets, sparse cells, arithmetic and common aggregate formulas, rectangular selection, fill, copy and paste, undo and redo, frozen headers, and local-first editing with periodic server revisions. The grid may contain hundreds of thousands of logical cells, but only a bounded viewport is mounted.
Full Excel compatibility, macros, real-time collaboration, pivot tables, and chart authoring are separate extensions.
The public interview prompt
Design a reusable browser spreadsheet. Explain:
- workbook, sheet, row, column, cell, formula, and range identity;
- parsing, dependency tracking, dirty propagation, cycle detection, and worker recalculation;
- editing, navigation, selection, clipboard conversion, fill, and atomic commands;
- virtualization, measurement, frozen regions, focus, and screen-reader behavior;
- undo, redo, persistence, autosave, revision conflicts, imports, and exports;
- loading, calculating, invalid formula, circular reference, offline, and recovery states;
- security, internationalization, performance budgets, observability, and testing;
- simpler alternatives, rejected approaches, rollout, and interviewer follow-ups.
What the premium solution covers
The full solution builds a sparse workbook model, stable coordinates, parsed formula graph, reverse-dependency index, dirty-cell scheduler, worker revision protocol, range model, clipboard transaction, command history, and bounded rendering surface.
Original media follows one edit through transitive recalculation, separates stable cell identity from A1 display notation, shows a clipboard rectangle becoming one reversible command, and maps the workbook engine's ownership boundaries. Two deterministic labs exercise cycle detection and atomic paste, undo, and redo.