AI & Technical question
How would you implement the sync feature of Google Drive app or Google Docs? How would you design the DB for G-drive?
- AI & Technical
- Hard
Practice this question out loud. An AI interviewer asks it, follows up like a real interviewer would, and scores your answer. Type or speak.
Start a mock interview on this question · Mock interview from a job description
What this question tests
System design thinking applied to a product problem: sync architecture and data modeling trade-offs.
How to approach it
- Clarify scope: syncing file edits across multiple devices with offline support and conflict resolution, not just upload/download.
- Describe the sync approach: chunk files into blocks, hash each block, and only transfer changed blocks to minimize bandwidth.
- Explain conflict handling: last-write-wins for simple cases, versioned branches or merge prompts for simultaneous edits like Docs.
- Sketch the DB schema: files table, versions table with block references, and a device-sync-state table tracking each client's last synced version.
- Discuss trade-offs: consistency versus latency, and how much local caching to keep for fast offline access.
- Define success metrics: sync latency, conflict rate, and failed sync rate.
What a strong answer includes
- Distinguishes file-level sync (Drive) from operational-transform or CRDT-based sync (Docs), since Docs needs real-time multi-user merging.
- Explains block-level diffing with a concrete example, e.g. only re-uploading a changed paragraph instead of the whole file.
- Proposes a versions table with a foreign key to a device_sync_state table so partial or failed syncs can resume.
- Flags conflict resolution as the hardest part and proposes a merge UI rather than silent overwrite.
Common mistakes
- Describing only the upload path and ignoring offline edits and conflict resolution.
- Proposing a schema with no versioning, which cannot support undo or collaborative editing.
Likely follow-up questions
- How would you handle two users editing the same paragraph offline at the same time?
- How would you scale this for a file with millions of small edits?
More ai & technical questions
- Design a simple load balancer for Google.com. What data structures would you use?Google · AI & Technical · Hard
- How does TinyURL work?Google · AI & Technical · Easy
- How would you explain cloud computing to your grandmother?Google · AI & Technical · Easy
- What happens when you enter a URL in your browser?Google · AI & Technical · Easy
- You’re part of the Google Search web spam team. How would you detect duplicate websites?Google · AI & Technical · Hard
- Explain the data pipeline for the last AI project you worked on. What were the top challenges in getting data, and how did you resolve them?Google · AI & Technical · Hard
More questions from Google
Learn the skill behind it
Chapters of the AI PM course that teach what this question tests.
- Chapter 1: Foundations: the model and the decisions it forces on you
- Chapter 8: Evals: define good and make the number defensible
- Chapter 6: Agents and agentic architecture