Skip to main contentSkip to user menuSkip to navigation

Design Google Translate

Design Google Translate: neural machine translation, multilingual models, and real-time language processing.

90 min readAdvanced
Not Started
Loading...

What is a machine translation system?

A machine translation system converts meaning from a source language into a target language. Modern systems usually encode the source text, generate target-language tokens, and then verify formatting, terminology, safety, and confidence before returning the result.

The hard part is not replacing words. The system must preserve meaning, names, numbers, tone, and structure across language pairs with very different data coverage. For this interview, design a service for 108 languages, 1 billion requests per day, a 35,000 request/s peak, and an interactive target below 200 ms at p95.

Correctness invariant

Preserve meaning, not word order

A fluent sentence is wrong when it changes an entity, quantity, negation, instruction, or relationship from the source.

Serving decision

Route by language and consequence

Language-pair evidence, domain, latency, and harm determine the model tier and release policy.

Degraded mode

Abstention is a valid translation result

When confidence or policy fails, ask for context, queue review, or return no translation instead of hiding uncertainty.

Separate the translation products

The word "translation" hides workloads with different deadlines and failure costs:

  • Interactive text snippets
    • Translate short messages and web text in under 200 ms at p95.
    • Preserve markup, names, numbers, and user-provided terminology.
  • Live conversation
    • Translate partial phrases quickly enough to preserve turn-taking.
    • Handle interruptions, code-switching, and corrected speech transcripts.
  • Document jobs
    • Preserve sections, tables, lists, links, and reading order.
    • Use an asynchronous path for long files and richer decoding.
  • High-consequence domains
    • Medical, legal, emergency, and safety instructions need domain policy and specialist review.
    • A general quality score must not authorize automatic release.

Ask questions that change the architecture

  1. Which language directions launch first? Supporting 108 languages creates 108 x 107 = 11,556 directed pairs, but traffic and data are highly concentrated.
  2. What is the user-visible deadline? Conversation, web, and document translation should not share one queue or model deadline.
  3. What context is available? A sentence alone may not reveal pronouns, formality, domain terms, or the intended meaning of an ambiguous word.
  4. May content be retained? Default to ephemeral request processing. Training or feedback reuse requires consent, provenance, minimization, and deletion behavior.
  5. What happens when quality is uncertain? Expose confidence and choose a bounded fallback; never silently claim that a pivot or low-resource route is equivalent.

State the scope explicitly

  • Translate text and parsed document segments; speech recognition and voice synthesis are adjacent systems.
  • Support glossary terms and document structure, but do not promise perfect layout reconstruction in the synchronous path.
  • Do not cache private text without a scoped, versioned, policy-aware key and an approved retention policy.
  • Do not automatically release consequential translations solely because the model is fluent.

No quiz questions available
Could not load questions file
Graded Challenge

Serving strategy for web-scale translation

Translation requests arrive at enormous QPS, and a large fraction are repeated common phrases ("hello", "thank you", short UI strings). How should you serve translations to minimize latency and cost?

Constraint: Low latency and low cost at enormous QPS, where a large fraction of requests are repeated common phrases.

Spotted an issue or have a better explanation? This page is open source.Edit on GitHub·Suggest an improvement