← Salesforce Interview Insights
Start by clarifying requirements and scale, then propose a high-level architecture that separates real-time collaboration from durable storage. Dive into data models for workbooks, sheets, cells, and formulas, and explain concurrency control using OT or CRDTs. Finally, discuss trade-offs in storage, sync, versioning, and permissions, tying choices to scalability and consistency needs.
Pro tip: Emphasize that the choice between OT and CRDTs depends on latency, offline support, and complexity; for a Google Sheets-like service, a hybrid approach with server-side OT for online editing and CRDTs for offline may be optimal. Also, mention that formula evaluation should be incremental and dependency-aware to avoid full recalculation.
Ask about expected number of concurrent editors per sheet, total users, offline support, and consistency requirements. Define functional and non-functional goals to guide design decisions.
Outline components: client apps, real-time collaboration service (WebSocket servers), API gateway, storage layer (document store, relational DB, or blob storage), and background workers for snapshots and versioning.
Design schemas for workbooks, sheets, cells, and formulas. Discuss sparse vs dense storage, formula representation (AST), and dependency graphs for efficient recalculation.
Compare OT and CRDTs for real-time collaboration, explaining how to handle conflicts, offline edits, and eventual consistency. Describe autosave and sync protocols.
Explain version history using snapshots and deltas, permission models (ACLs, RBAC), and trade-offs between storage options (e.g., SQL vs NoSQL), sync approaches (push vs pull), and consistency models.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.