The interview problem

Practice prompt

Design OCR routing for pages containing multiple writing systems and mixed orientation.

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

Detect regions, estimate script and orientation per region, then choose supported OCR models. Permit multiple candidates or abstention for uncertain regions. Train and test on separate document collections; preserve coordinates and reading order for reconstruction.

2. Trace the design or derivation

Regions
  → script and orientation scores
  → OCR selection
  → coordinate merge
  → review

Maintain a fallback for unsupported scripts rather than producing confident garbage. Report the fraction of text excluded from evaluation. An apparent accuracy gain from rejecting all difficult regions should be visible as a coverage loss.

3. Calculate the example

A page has 80 Latin words and 20 Japanese words. A Latin-only route that reads all 80 correctly still has at most 80% word coverage before evaluating the remaining regions.

4. Failure cases and trade-offs

Page-level majority routing discards minority-script regions. Script is not language: Latin letters alone do not distinguish English from many other languages. Incorrect orientation can overwhelm model selection.

5. Validation, follow-ups and self-review

Measure region coverage and transcription error by script. Follow-up: how should numbers and shared punctuation be routed? Self-review: distinguish script, language and layout.

Sources and related practice

Technical reference: tesseract-ocr.github.io — Language/script selection and OCR invocation; region routing is original.

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 Recover reading order from complex documents; Read handwritten form fields with reviewable uncertainty.

Continue your preparation

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