KatInterview

Design a Spoken Role-Play Tutor for Many Languages

System DesignModel answer
HardModel answerSystem Designsystem-designspeechlow-latency

Last updated

Design a real-time multilingual voice role-play practice feature: content model, session state machine, low-latency audio pipeline, offline mode, personalization, scaling and privacy.

You are designing a feature for a language-learning app where a learner can pick any real-world scenario — ordering at a restaurant, a job interview, checking into a hotel — and hold a spoken, multi-turn dialog with an AI partner in their target language. The AI plays the other role; the learner speaks their lines and gets live hints plus an end-of-session report on pronunciation, grammar, vocabulary and whether they accomplished the scenario's goals.

In a design interview, walk through:

  1. Clarify and size it. Functional requirements, non-functional targets (latency, availability, cost), and back-of-the-envelope load estimates for sessions, turns and audio volume at millions of users.
  2. User flows from discovery through briefing, the dialog loop, wrap-up and progress.
  3. Content modeling — how scenarios, roles, dialog steps, objectives and localized text/audio are represented, versioned and authored.
  4. Session orchestration — the state machine per session, what state is held where, and how reconnects and pod failures are survived.
  5. Audio pipeline and latency — capture, voice activity detection, streaming speech recognition, dialog generation, speech synthesis, and a concrete end-to-end latency budget with the techniques that make it fit.
  6. Offline / degraded mode, personalization and adaptive difficulty, progress tracking, and localization for many locales.
  7. Service architecture, storage choices, APIs, rate limiting, and how it scales cost-effectively.
  8. Privacy and security of voice data, plus how you would experiment with and roll out new scenarios.

State your assumptions, justify trade-offs, and call out the edge cases you would protect against.

Hints

Hint 1

Anchor the whole design on one number: ended-speech-to-first-AI-audio latency. Every component choice (streaming vs. batch, cached vs. generated audio) should be justified against that budget.

Hint 2

Separate "conversation" from "assessment." Scoring pronunciation and grammar is expensive and does not need to be on the critical path — run it asynchronously after the turn.

Hint 3

Pre-rendered audio and speculative responses only work because most early-level dialog is predictable; say explicitly where scripted content gives way to open generation as proficiency rises.

Hint 4

Voice is sensitive data: decide retention, consent and deletion up front rather than bolting them on.