Design a collaborative spreadsheet
GrammarlySoftware Engineer · OnsiteLast updated
This question evaluates system design and distributed-systems competencies such as real-time collaboration, concurrent edit conflict resolution, data modeling for workbooks and sheets, session management, persistence and concrete API design.
Design an online spreadsheet service similar to Google Sheets.
Users can open the same workbook concurrently and directly edit cells, formulas, rows, and columns in real time. The system must keep all clients synchronized, handle disconnect/reconnect, and resolve concurrent edits safely. The interviewer also expects concrete API design, including important request parameters.
Discuss:
- functional and non-functional requirements,
- data model for workbooks, sheets, cells, revisions, and operations,
- session management and real-time update delivery,
- conflict resolution for simultaneous edits,
- handling row/column insertions and deletions,
- persistence, snapshots, replay, and recovery,
- formula recalculation,
- external APIs for opening a session, fetching a sheet, submitting edits, subscribing to updates, and catching up after reconnect,
- scaling, latency, and observability.
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.