KatInterview

Design a Text-to-Speech Platform: Scope It, Stress It, Extend It

System DesignModel answer
MediumModel answerSystem Designtext-to-speechasync-processingapi-design

Last updated

Prototype a scalable TTS service using a hosted synthesis API, then justify its trade-offs, find its first bottleneck, and plan bulk-document narration support.

A product team on an AI platform org wants to ship a text-to-speech (TTS) capability as a service. You have a take-home budget of roughly 8–12 hours to produce a working prototype, a short design write-up, and session logs from whatever AI coding assistants you use. Synthesis itself is supplied: you may call an existing TTS model or a hosted TTS API, and you should state that assumption up front (and confirm it if interviewing). The interesting work is everything around the model — the API, the request pipeline, storage, retries, progress reporting, and the developer experience.

Assume during the review that your submission is a prototype and that every shortcut will be found and interrogated.

Part 1 — Scope and build. Decide what the prototype does inside the time box and what it explicitly defers (with reasons). Specify the public API, the request flow for both short and long inputs, the data model (so repeated requests, retries and progress are possible), and how you keep the API responsive while synthesis runs. Also describe how you direct AI coding agents so that the submitted logs demonstrate a disciplined workflow rather than paste-and-pray.

Part 2 — Trade-off review. Present a rough throughput and cost estimate that identifies where the system saturates first. Defend your choices on chunk size, streaming audio versus delivering finished files, and self-hosted versus hosted synthesis. Name customer needs the prototype does not yet meet (voice consistency across chunks, pronunciation control, quota enforcement, etc.) and UX gaps around failures, duplicates and progress.

Part 3 — New requirement. A customer wants to submit many long documents in one API interaction, be notified when each narration completes, and hear a single consistent voice throughout each document. Explain the API and system changes, how voice identity survives chunking and model upgrades, how you protect against retries creating duplicate work, and give a task-level estimate plus a roadmap order with success metrics.

Hints

Hint 1

Separate the synchronous control plane (submit, poll, fetch) from the asynchronous data plane (chunk, synth, stitch) — most answers collapse them and then have no story for long inputs.

Hint 2

Pick concrete numbers (characters per chunk, requests per second, seconds of audio per character) and let the estimate tell you the bottleneck instead of asserting it.

Hint 3

For Part 3, think about what an idempotency key protects, what a webhook needs in order to be safely retried, and what actually makes a voice 'the same' across chunks and across provider model versions.