Question presented to candidate: "Design Google Drive. Users upload files of any size from web, desktop and mobile, organise them in folders, share files and folders with people and groups at different permission levels, see changes from other people quickly, and search across everything they can access. Focus on the metadata, sharing and sync parts; assume a blob store exists."
What a strong answer should cover:
- Metadata as a graph of items with stable IDs and a parent pointer (Drive moved to one parent per item in 2020, with shortcuts for extra locations), separate from the blob store holding file content
- Sharing: permissions granted on a file or folder and inherited by everything below; effective access = strongest grant on the item or any ancestor; a folder move changes access for a whole subtree with one parent-pointer write
- A dedicated authorization service (Google's Zanzibar paper describes relation tuples such as "doc#viewer@user" in the system Google built for authorization across many of its products), with caching and consistency tokens so a revoke is not ignored
- A per-user change feed with page tokens (Drive's API exposes
changes.getStartPageTokenandchanges.list), including "removed" entries when access is lost, plus push notifications - Resumable uploads with a session URI and byte offsets (the server reports what it has with
308and aRangeheader; chunks in multiples of 256 KiB per Google's upload docs), and quotas such as 5 TB per file and 750 GB per user per day - Search over names, content and permissions; native Docs editing as a separate collaborative system; capacity math and what breaks at 10x
Clarifying questions expected:
- Which clients, and is offline desktop sync in scope or only web and mobile?
- Sharing model: users, groups, domains, link sharing?
- Scale: users, items per user, read/write ratio for metadata?
Code / implementation expected: Optional โ the data model and the permission and change-feed logic matter most; the example simulates inherited sharing, a revoking move, a change feed and a resumable upload.