Design a Real-Time Language Translation in Documents

Hard45 min
1 / 30
System design answer

Design a Real-Time Language Translation in Documents

Hard45 min30 sections
understanding•11 min read

Problem Statement: Multilingual Documents as a Concurrency Problem

Frames inline document translation as a segment-level concurrency and synchronization challenge, not a thin wrapper over a translation API.

Problem statement

Design a document editing platform that provides real-time machine translation for each paragraph or segment. Users can correct the machine-translated text, keep multiple language versions in sync, and always reference the original text. Think of a wiki page, a product spec, or a help-center article that must exist in English, Japanese, German, and Spanish at once, edited by different people, and shown side-by-side with the source.

The trap is to treat this as “call Google Translate and render the result.” That view collapses the moment two humans and a machine all write to the same text. A machine translation is a draft, not a fact. A reviewer corrects it. Then the author edits the English source. Now the Japanese correction is stale, but it contains human judgment that a re-translation would destroy. The system must decide, per segment, whether to re-translate, preserve the human edit, or merge the two. That decision is the heart of the design.

Why this is distinctive

A normal collaborative editor synchronizes one text among many cursors. A multilingual editor synchronizes N parallel texts that are semantically linked but not character-linked. Editing segment 7 in English must not move the cursor of the person editing segment 7 in Japanese, yet it must tell them their translation may now be wrong. The unit of coordination is the segment, not the character. Inside a segment, each language is its own collaborative text, handled by a CRDT or Operational Transform. Across segments and across languages, we need alignment, status, staleness, and version lineage.

This creates four distinct subsystems that a strong answer keeps separate:

  1. Collaboration plane: CRDT/OT per language version, presence, cursors, conflict-free merges.
  2. Segmentation and alignment plane: splitting documents into translatable units and mapping source segments to target segments, including 1:1, 1:N, and N:1 alignments.
  3. Translation plane: machine-translation integration, translation memory, caching, and human correction workflow.
  4. Versioning and sync plane: per-language revision history, staleness propagation, and language-toggle views.

A good interview answer states up front that machine translation is an eventually-consistent enrichment, while segment identity and human corrections are strongly-consistent source-of-truth data. Losing an MT draft is cheap; losing a reviewer’s correction is a data-loss incident.

Public operating baseline versus design assumptions

Public figures set the context. Google has stated that Google Translate processes on the order of 100 billion words per day across well over 100 languages. DeepL, founded in 2017, markets higher BLEU-style accuracy than several competitors in blind comparisons and sells an enterprise API used for document translation. Microsoft Translator powers real-time translation in Office, Bing, and historically Skype Translator. These are cited company figures, not the requirements of our fictional system.

For capacity planning this answer assumes a mature enterprise platform with 2 million registered documents, 250,000 actively edited documents, an average of 40 segments per document, 8 target languages per document, and a 4x event peak. Unless a number is tied to a citation, it is an explicit design assumption, target, or budget.

The four planes, restated as invariants

  • Collaboration must never lose a human keystroke, even when the MT service is down.
  • A segment is the smallest independently translatable and versionable unit.
  • Machine output is a labeled draft; human output is authoritative and must survive re-translation.
  • Every language version carries its own revision history and its staleness relative to the source.

Keeping these planes and invariants separate is what lets the collaboration layer degrade without corrupting translation state, and lets the MT provider be swapped without touching the version model.

Key Highlights

  • •The unit of coordination is the segment, not the character; each language is its own CRDT/OT text.
  • •Machine translation is an eventually-consistent draft; human corrections are strongly-consistent truth.
  • •Source edits must propagate staleness to translations without clobbering human judgment.
  • •Four planes: collaboration, segmentation/alignment, translation, and versioning/sync.
  • •Public scale (Google Translate ~100B words/day) is context; every uncited number here is an assumption.
  • •Losing an MT draft is cheap; losing a reviewer correction is a data-loss incident.
Lead With the Segment
State in the first two minutes that the segment, not the character, is the unit of translation, sync, and versioning. This instantly distinguishes a multilingual-docs architecture from a translation-API wrapper.
Do Not Draw a Translate Button
A design where translation is a one-shot call with no status, staleness, or human-override path will fail a serious interview. The hard part is what happens after the translation returns.

Section Rescue Kit

Buzzwords to use:

SegmentTranslation Status

Safe statements:

  • "I will separate losing an MT draft, which is cheap, from losing a human correction, which is data loss."
  • "Before choosing CRDT versus OT or an MT provider, let me define which data is authoritative and which is a cacheable draft."
Design a Real-Time Language Translation in Documents - System Design | WinJob | WinJob