The interview problem

Practice prompt

A backup service sees large files with small insertions. Compare fixed-size chunks with content-defined boundaries and design safe references to shared chunks.

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 immutable encrypted backup snapshots and collision-resistant content identifiers. A rolling boundary rule can resynchronize after inserted bytes, bounded by minimum and maximum chunk sizes. Store ordered chunk references in a file manifest and validate reconstructed content. Deduplication scope and encryption design must preserve tenant isolation; a shared chunk identifier must not disclose another tenant's data presence through an API.

2. Trace the design or derivation

Scan rolling boundaries
  → hash chunks
  → upload missing chunks
  → commit snapshot
  → retain references

The snapshot manifest needs an ordered chunk list and integrity hashes, not just an unordered set of deduplicated blocks. Commit the manifest after required chunks are durable. Garbage collection must respect every retained snapshot and in-progress publication lease so a space-saving sweep cannot delete a block just before it becomes reachable.

3. Calculate the example

A 100 MB file split into 1 MB fixed chunks has 100 chunks. Inserting one byte near the beginning shifts nearly every later fixed boundary, potentially defeating most chunk reuse. Content-defined chunking can regain matching boundaries downstream, but the actual reused-byte percentage depends on content and parameters; it is not guaranteed to be 99%.

4. Failure cases and trade-offs

Chunk corruption affects every snapshot referencing it. Garbage collection must account for all committed manifests and in-progress snapshot publication. Smaller chunks improve reuse granularity but grow indexes and requests; larger chunks reduce metadata while losing fine-grained reuse.

5. Validation, follow-ups and self-review

Measure reuse after insertions, random rewrites and compressed-file changes. Restore complete files, inject missing chunks and race snapshot deletion with creation. Follow-up: how is chunk integrity checked before deduplication reuse? Reward reconstruction correctness and qualified reuse claims.

Sources and related practice

Technical reference: restic.readthedocs.io — Backup format and content-defined chunking.

Source publication/update: Not established. 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 container artifact registry; Reclaim unreferenced blobs safely.

Continue your preparation

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