The interview problem

Practice prompt

Design a scan-cleanup service that removes noise while preserving small text and original content.

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 users can inspect originals and restoration is an optional derivative. Establish deskewing and classical denoising baselines, then compare learned restoration on paired clean/noisy scans. Keep immutable originals and transformation metadata. Separate text regions from decorative images when choosing strength. Split by scanner and document source. Evaluate character preservation and human-reviewed alterations, not only visual preference or pixel similarity.

2. Trace the design or derivation

Retain original
  → identify regions
  → restore conservatively
  → compare changed evidence
  → publish derivative

A useful review interface highlights changed text-like regions, especially punctuation and narrow strokes. Store the restoration strength and model hash with the derivative so a disputed image can be reproduced. When the original is illegible, describe the output as an enhancement hypothesis rather than a recovered factual reading.

3. Calculate the example

In a 1,000-character sample, a cleanup model removes 30 recognition errors but introduces 10 new substitutions. Net error reduction is 20 characters, yet the ten new changes require inspection because they may alter amounts or names.

4. Failure cases and trade-offs

Generative cleanup can create plausible strokes that were absent. Unpaired translation provides distribution matching, not identity preservation. Lower strength retains noise but reduces unsupported detail. For low-confidence regions, show the original crop rather than replacing evidence with a guessed restoration.

5. Validation, follow-ups and self-review

Use tiny decimals, faded strokes and blank areas as adversarial fixtures. Follow-up: what changes for archival evidence? Self-review: distinguish readability improvement from faithful reconstruction and retain reversible provenance.

Sources and related practice

Technical reference: arxiv.org — Unpaired image translation and cycle consistency, which do not establish evidence fidelity.

Source publication/update: Submitted March 30, 2017; revised August 24, 2020. 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 Read handwritten form fields with reviewable uncertainty; Evaluate learned image compression for a product.

Continue your preparation

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