Design a collaborative spreadsheet
Company: Grammarly
Role: Software Engineer
Category: System Design
Interview Round: Onsite
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.
Quick Answer: 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.