Resumable Chunked Upload Service For Large Source Videos
Last updated: November 29, 2026
Quick Overview
Implement the server-side state for a resumable upload of a multi-gigabyte video: accept chunks with per-chunk SHA-256, make retries idempotent, report missing chunk ranges so a client can resume, and verify the whole file hash on completion.
Luma AI
November 29, 20260
0
0 solved
Implement the server-side state for a resumable upload of a multi-gigabyte video: accept chunks with per-chunk SHA-256, make retries idempotent, report missing chunk ranges so a client can resume, and verify the whole file hash on completion.
Features like modifying an existing video or API workflows that ingest customer footage depend on reliable uploads over flaky mobile and browser connections. The interviewer is checking idempotency, integrity checks, and clear state transitions more than raw algorithms.
What the Interviewer Expects
- Validate index, length and checksum before storing
- Treat a byte-identical retry as success and a different payload as a conflict
- Return compact missing ranges for resume
- Verify the full-file hash before marking complete
- Explain where state lives in production (object storage multipart plus a metadata row)
Key Topics to Cover
How to Approach This
- Apply SOLID principles. Single Responsibility makes code testable, Open/Closed makes it extensible.
- Choose data structures based on access patterns, not familiarity.
- Prefer immutable data and message passing over shared mutable state for concurrency.
- Design APIs with RESTful conventions, versioning, meaningful errors, and pagination from day one.
Possible Follow-up Questions
- How would you make this safe when two servers receive chunks for the same upload?
- How would you expire abandoned uploads and their parts?
- How would you let the client upload chunks in parallel without exceeding a bandwidth budget?
- Why might you avoid holding the whole file in memory at completion?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice System Design ProblemsSample Answer
Requirements
Create an upload with total_size, chunk_size and the expected file SHA-256. Clients PUT chunk i with its bytes and hash in any order, possibly more than once. Clients can ask which chunks are mi...
High-Level Design
Keep a map from chunk index to stored part. Every write is validated (index range, exact expected length, chunk hash). Duplicate writes compare against what is stored. missing() collapses absent ind...