Design a Sub-Second Streaming Voice Agent Pipeline
Last updated: November 29, 2026
Quick Overview
Design the real-time system that takes caller audio from a phone or web call, runs streaming speech-to-text, an LLM and text-to-speech, and plays the reply back with under one second of perceived latency at tens of thousands of concurrent calls.
Retell AI
November 29, 20260
0
0 solved
Design the real-time system that takes caller audio from a phone or web call, runs streaming speech-to-text, an LLM and text-to-speech, and plays the reply back with under one second of perceived latency at tens of thousands of concurrent calls.
This is the heart of Retell's product, so a senior backend loop in this style expects you to reason about a latency budget stage by stage rather than boxes and arrows. Interviewers check streaming between stages, interruption handling, session affinity and how the design degrades when a model provider slows down.
What the Interviewer Expects
- Break end-to-end latency into a budget per stage and measure time to first audio byte
- Stream between every stage instead of waiting for complete outputs
- Explain turn detection, interruption and cancellation of in-flight LLM and TTS work
- Keep a call pinned to one stateful session worker and explain failover
- Plan for provider fallbacks and multi-region placement near carriers
- Cover observability per call (latency traces, transcripts)
Key Topics to Cover
How to Approach This
- Start by clarifying functional and non-functional requirements with the interviewer.
- Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
- Draw a high-level architecture first, then deep dive into 1-2 critical components.
- Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
- Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
- How would you start generating a reply before the caller has finished speaking?
- A TTS provider's p99 doubles; what does the system do in the next minute?
- How would you run tool calls (book an appointment) without dead air?
- How would you size and autoscale session workers for a Monday morning call spike?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice System Design ProblemsSample Answer
Requirements
Functional: inbound and outbound phone calls (SIP/RTP via carriers) and web calls (WebRTC/WebSocket); streaming ASR, LLM with tools and knowledge base, TTS; interruptions; transcripts and post-call ev...
High-Level Design
Edge media gateways terminate SIP/RTP and WebRTC and convert to a common 20 ms PCM frame stream. Each call is assigned to a session worker (stateful, one process holds many calls) through a router...