M9-033M9: Senior ML & AI System DesignLLM Serving, RAG & Agent SysDesignHard
⚡Flashcard Drill➔Mastery:
Design a Sub-350ms Full-Duplex Audio/Voice Pipeline with Instant Barge-In
🎯 Active Recall Self-Check (Draft First, Verify After)
Login-free practice tracker: recall core answer, audit pitfalls, and log review status.
Step 1 · Draft your concise answer & assumptions
Step 2 · Check Pitfalls & Follow-up Inquiries
📐 Mathematical Definition
⚡ One-Sentence Core Answer
Combine WebRTC UDP transport, acoustic echo cancellation, semantic End-of-Turn detection, and instant TTS/KV-playback rollback for sub-350ms natural barge-in voice agents.
📌 Key Takeaways
- •L1 Transport & AEC: run Opus 20ms frames over WebRTC UDP with strict Acoustic Echo Cancellation before VAD so agent speech never self-triggers
- •L2 Dual Turn-Taking: pair Silero VAD with a fast semantic End-of-Utterance (EoU) classifier to separate mid-thought pauses from completed turns
- •L2 Instant Barge-In: upon 150ms confirmed user speech, emit immediate client audio-buffer flush and cancel in-flight LLM/TTS streams
- •L3 Spoken-Offset Alignment: truncate unplayed LLM tokens from conversation history using client playback-ack timestamps so context matches what the user heard
📐 Mathematical Derivations
Hysteresis gating requires consecutive non-echo frames above to fire interrupt; sentence-prefix chunking pipelines LLM token streaming directly into TTS vocoder frames.
🏭 Production Trade-offs
1) Semantic EoU adapts wait windows (250ms on complete questions vs 900ms on trailing conjunctions); 2) Keep LLM inference text-only vs native Speech-to-Speech depending on tool-calling reliability.
⚠️ Common Interview Pitfalls
- ✕Leaving unplayed post-barge-in assistant tokens inside multi-turn prompt history
- ✕Streaming raw PCM over TCP WebSockets, suffering multi-second head-of-line stalls on packet loss
🎯 Interviewer Follow-up Inquiries
- ?How do you prevent background speakers in a noisy cafe from triggering false barge-in interrupts?
- ?How should the orchestrator handle mid-tool-call user corrections arriving during a 1.5s API wait?
⚡
Test muscle memory on this topic via 3-Layer Flashcards
Active Recall: Mentally formulate Prompt ➔ Math Derivation ➔ Benchmark Implementation in 3 minutes.
📚