The interview problem

Practice prompt

A client resumes a large interrupted download while the server may replace the file. Design range requests that never splice bytes from different representations.

Original practice, not a reported company interview. Scenarios and numbers are illustrative. Interview date: not applicable. Sources retrieved October 1, 2026.

1. Scope and worked approach

Assume the server supports byte ranges and strong representation validators. Save the validator and completed byte ranges with the partial file. On resume, send a conditional range request using the appropriate validator semantics; if the representation changed or the server returns a full response, restart or use a verified immutable-version URL. Check returned ranges and total size before writing offsets. Validate a final whole-object digest when provided.

2. Trace the design or derivation

Fetch metadata
  → request range with validator
  → verify representation
  → append or restart

Persist the validator alongside the byte checkpoint. When the server returns a full representation instead of the requested partial range, replace the partial local file rather than append it. Content encodings also affect which representation the byte offsets refer to; pin those semantics before resuming a download.

3. Calculate the example

A 1,000-byte file interrupted after bytes 0–399 needs bytes 400–999, which is 600 bytes because byte ranges are inclusive. If version two inserts 50 bytes at the front, appending its bytes 400–999 to version one's prefix creates a corrupt hybrid despite matching nominal offsets.

4. Failure cases and trade-offs

Compression or content negotiation can change the byte representation. A weak validator may be insufficient for safe range assembly. A server can ignore Range and return the entire object; appending that response duplicates content. Immutable URLs simplify resumption but require retention and authorization decisions.

5. Validation, follow-ups and self-review

Test replacement, full-response fallback, unsatisfiable ranges and multiple chunks received out of order. Follow-up: what metadata survives a client crash? Reward representation identity, inclusive arithmetic and response validation.

Sources and related practice

Technical reference: httpwg.org — HTTP validators, ranges, preconditions and representation semantics; customer workflows are original examples.

Source publication/update: June 2022. Retrieved October 1, 2026. The workflow, calculations and review exercises are original; this reference is not evidence that a company asked this question.

Continue with Design a file-storage service; Recover interrupted large customer uploads.

Continue your preparation

Choose a connected learning path or browse more System design questions. Read our editorial method and attribution policy.