The interview problem

Practice prompt

Design an image-compression experiment that reduces storage without damaging text, edges or downstream recognition.

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 an existing codec baseline and reversible access to originals during evaluation. Train a rate-distortion model or compare available models at matched file sizes. Measure actual encoded bytes, decode latency and task-specific quality by image class. Keep text-heavy and low-light slices separate. Publish codec/model compatibility metadata and retain a decoder migration plan; a neural checkpoint is part of the storage format.

2. Trace the design or derivation

Encode at target rate
  → measure bytes
  → decode
  → assess task fidelity
  → version format

Include the original image size and content type in the rate comparison; equal bits per pixel and equal bytes answer different product questions. A storage rollout needs decoder availability across all consumers, including exports and disaster recovery. Keep a baseline codec fallback for images outside the validated domain.

3. Calculate the example

Compressing 1 million images from 300 KB to 180 KB saves 120 GB in decimal units. If a decoder takes 15 ms instead of 3 ms, 100 reads/s require an additional 1.2 CPU-seconds/s under serial CPU-equivalent assumptions.

4. Failure cases and trade-offs

A visually pleasing reconstruction can alter small text. Average perceptual scores can hide rare catastrophic artifacts. More compression lowers storage but can increase serving compute and migration risk. Require byte-level corruption detection separately from perceptual evaluation.

5. Validation, follow-ups and self-review

Compare codecs at equal byte budgets with OCR and human review slices. Follow-up: what happens if a model checkpoint is lost? Self-review: include rate, distortion, latency and long-term decode compatibility.

Sources and related practice

Technical reference: arxiv.org — Learned image compression with a rate-distortion objective.

Source publication/update: Submitted November 5, 2016; revised March 3, 2017. 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 Restore scanned images without inventing evidence; Gate low-quality uploads before downstream inference.

Continue your preparation

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