A production uploader is a transfer coordinator tied to a server-side asset lifecycle. It selects a protocol, schedules bounded work, reconciles authoritative progress, survives interruption, and never confuses transferred bytes with safe published content.
A file input and one POST request can be enough for a profile photo. The design changes when files are hundreds of megabytes, networks switch, tabs reload, several files compete for bandwidth, or uploaded content must be scanned before anyone can open it.
The useful mental model has two related resources. An upload session is temporary coordination state: expected size, accepted offsets or parts, expiry, and finalization rules. An asset is the durable product object: ownership, processing status, derivatives, retention, and access policy. Completing the first does not automatically publish the second.
Start with product constraints
Ask which file types and sizes matter, whether users select one file or a queue, how long a session may resume, and whether a file has to be processed. Clarify mobile use, metered networks, tab reloads, directory selection, previews, virus scanning, legal retention, and public sharing.
For this interview, assume authenticated users can upload several photos, documents, or videos. Files range from kilobytes to several gigabytes. Large files support pause, resume, retry, and reload recovery. The browser transfers directly to object storage through short-lived authorization, while the application server owns sessions, finalization, processing, and asset access. Storage internals and transcoding implementation are outside scope.
The public interview prompt
Design a reusable file-upload component platform. Explain:
- selection, local validation, queueing, previews, replacement, and cancellation;
- single-request, offset-based, and multipart protocol choices;
- bounded concurrency, scheduling, retries, backoff, pause, resume, and reload recovery;
- progress semantics, checksums, part generations, reconciliation, and finalization;
- frontend, application API, object storage, worker, and asset-service boundaries;
- processing, quarantine, failure, expiry, deletion, and publication states;
- accessibility, internationalization, privacy, and security;
- performance, memory, observability, testing, rollout, and simpler alternatives.
What the premium solution covers
The full solution builds the upload state machine, file identity boundary, strategy selector, part scheduler, acknowledged-byte ledger, retry generations, session persistence, server reconciliation, finalization command, processing lifecycle, and safe preview rules.
Original media follows a multipart upload through failure, retry, pause, reconciliation, verification, and completion. Three static explanations separate asset lifecycle, security ownership, and progress accounting. Two deterministic labs let you vary transfer strategy and manipulate the server acknowledgement ledger.