Design a Blob Storage Service
Design durable batched large-file upload, synchronous request outcomes, authorized download, content-addressed byte reuse, offline terminal notification, and reference-safe deletion with a justified cleanup trigger.
Problem statement
For this exercise, assume authenticated tenants store opaque objects under a bucket and object key. Clients upload objects as large as 5 GB through batched, independently retryable numbered-part requests, may resume interrupted transfers, download only an active authorized version, and delete an object idempotently.
Every synchronous control-plane call returns a durable accepted, rejected, duplicate, conflicting, pending, or already-completed outcome without waiting for long-running verification; a client may poll that request outcome after disconnecting.
An upload publishes one immutable version only after its complete part manifest, type and size rules, and claimed SHA-256 digest are durable and independently verified.
When background verification or publication reaches terminal success or failure, the service must produce one user-visible offline notification through a retry-safe delivery workflow, while polling remains the recovery path.
A retry with the same request identity returns the original outcome, and a stale completion cannot replace a newer version. Verified versions with identical bytes share one content-addressed blob record while retaining independent tenant, key, version, and authorization metadata.
A digest match alone must never publish unverified bytes, and concurrent completions for the same content must converge without losing a reference.
Delete immediately makes the active key unavailable, writes a tombstone, and removes only that version's reference; physical bytes become purge-eligible after the seven-day safety window only when no live or retained reference remains, and eligible bytes must be physically deleted within 24 hours.
Explain how a delete finds out, safely under concurrent uploads of the same bytes, whether any reference to the content remains, and whether cleanup is driven by a scheduled sweep, by events, or both.
Design the synchronous APIs, durable upload and request state, batched byte and metadata paths, validation and publication boundary, offline notification outbox, concurrency controls, failure recovery, and garbage collection.
Public sharing, folder hierarchies, search, object listing, and cross-region replication are outside scope.
What to build
- An authorized client can create or resume a batched upload and atomically publish one fully validated object version under a bucket and key, reusing an already verified content blob without publishing duplicate bytes.
- Every synchronous mutation returns or recovers a durable immediate outcome, and an upload that later succeeds or fails produces one retry-safe offline terminal notification with polling as a recovery path.
- An authorized client can download the bytes and metadata of the currently active object version without observing an incomplete or unvalidated upload.
- An authorized client can idempotently delete the active object so new downloads fail immediately and shared bytes are reclaimed safely only after retention and the final reference are gone.
At scale
- For this exercise, assume 100 million retained objects averaging 10 MB and no larger than 5 GB.
- For this exercise, assume peaks of 5,000 upload completions and terminal notifications, 20,000 downloads, and 1,000 deletes per second.
- For this exercise, target 250 milliseconds p95 for healthy synchronous metadata operations, make a terminal upload notification eligible within 60 seconds, and use direct streaming for large byte transfers.
- For this exercise, acknowledged object bytes and metadata must survive a process or single-zone failure in one multi-zone home region, and deleted bytes remain reclaimable for seven days before purge, then are physically deleted within 24 hours of becoming eligible.