The interview problem
Build a voice assistant that listens and responds in real time, allows users to interrupt, and can look up or modify a customer booking.
Original practice question. Audio-buffer processing appears in a public July 2026 Amazon report, but this complete voice-assistant prompt is not reported as a company question. Reviewed September 26, 2026. All workload numbers and acceptance thresholds below are illustrative practice assumptions.
1. Define what real time means
Clarify languages, noisy environments, concurrent sessions, accessibility needs and whether the system can perform irreversible actions. For this exercise, start with lookup and a confirmation step before a booking change. Track time from end of user speech to first audible response, interruption-to-silence delay and successful task completion. Fast speech that confidently announces an uncommitted action is a product failure.
Use 5 minutes for requirements, 10 for transport and turns, 12 for the processing path, 10 for failure drills and 8 for evaluation. Compare a speech-to-text → language-model → text-to-speech pipeline with a native speech model; the first is easier to inspect, while the second may preserve richer audio information.
2. Keep conversation turns authoritative
Create a session with a short-lived credential and permitted tools. Audio frames carry sequence numbers and timestamps. Use a real-time media transport such as WebRTC when appropriate for the client; a server-side streaming connection may suit controlled integrations. Bound jitter buffers and processing queues rather than retaining arbitrarily old audio to appear lossless.
The turn controller issues a generation ID for each response. On user interruption, stop local playback promptly, cancel outstanding generation and discard late audio from the old generation. Track what was actually played, not merely synthesized, so future context does not assume the user heard an entire interrupted sentence. Durable tool actions live in their own state machine with action IDs and authorization checks.
3. Budget media and response latency
For uncompressed mono input at 16,000 samples/second and two bytes/sample, audio is 32 KB/second per session. At 10,000 simultaneous sessions that is 320 MB/second of inbound PCM, excluding framing and replication. A 200 ms buffer holds 6.4 KB/session or 64 MB total. Encoded transport changes bandwidth, and the processing system may use a different sample rate.
An illustrative serial budget after the final user sample is 250 ms for endpoint detection, 150 ms for final recognition, 300 ms for the first generated text and 150 ms for initial synthesis: 850 ms before network and playback delay. Streaming may overlap stages, so measure the critical path rather than blindly summing timings that execute concurrently. Test p95 and p99 under load, not only a quiet demo.
4. Interruption does not roll back a booking
If the assistant submitted a booking change before interruption, cancelling speech cannot reverse that request. Query the action by its idempotency key and state the actual outcome when the conversation resumes. Never announce success merely because the tool call was dispatched. If status is unknown, say it is pending and reconcile.
For network loss, preserve bounded session metadata and tool outcomes, then require a fresh authenticated connection. Avoid replaying stale audio as a new user command. When processing falls behind, degrade explicitly or ask for repetition; silently dropping arbitrary middle frames can change meaning. Separate recording retention from transient audio buffers and let the product define whether recordings are stored at all.
5. Evaluate conversation quality
Build test conversations with background noise, accents, corrections, silence, overlapping speech, failed tool calls and interruption immediately after confirmation. Measure task completion and unauthorized-action rate alongside word error rate. A transcript error on a booking date matters more than a harmless filler-word error; use task-specific evaluation slices.
Foundation implementations can use push-to-talk to simplify endpointing. Full-duplex conversation improves naturalness but introduces echo, false interruption and overlapping-state problems. Defend the added complexity through user need and measurable outcomes.
6. Follow-ups and rubric
Foundation: trace one turn and its latency budget. Senior: handle a response that arrives after cancellation. Staff: recover a paid booking action after both the audio connection and tool response are lost.
Score 0–2 each for turn identity, bounded buffering, interruption behavior, tool-action correctness and task-oriented evaluation. Two points need a concrete mechanism and limitation. “Cancel the request” is insufficient without identifying whether it cancels speech, computation, or an already committed external action.
Sources and next steps
References support the underlying concepts; the proposed architecture, exercises, and rubric are our own. Review streaming inference and ambiguous delivery outcomes.
Continue your preparation
Choose a connected learning path or browse more ML system design questions. Read our editorial method and attribution policy.