Stabilize Streaming ASR Partials Into Committed Words
Last updated: November 29, 2026
Quick Overview
Design a class that receives successive partial transcripts from a streaming speech recognizer and commits a word to downstream consumers only once it appears in the same position in the last k partials, never retracting committed words.
Retell AI
November 29, 20260
0
0 solved
Design a class that receives successive partial transcripts from a streaming speech recognizer and commits a word to downstream consumers only once it appears in the same position in the last k partials, never retracting committed words.
Retell starts LLM work before the caller finishes speaking, so it needs a stable prefix of the transcript early, while streaming ASR keeps revising its guesses. This question checks state management over a stream, longest common prefix reasoning, and an explicit policy for revisions after commit.
What the Interviewer Expects
- Keep a bounded window of the last k hypotheses
- Commit the longest common prefix of the window beyond what is committed
- Never retract committed words and say what to do when ASR revises them
- Handle the final transcript flush
- Discuss the latency versus correctness trade-off of k
Key Topics to Cover
How to Approach This
- Clarify input constraints and edge cases before writing code.
- Walk through your approach verbally and confirm with the interviewer before coding.
- Start with a brute force solution, then optimize. Mention time and space complexity.
- Test your solution with examples, including edge cases like empty input or duplicates.
- Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
- How would you use ASR word confidence or timestamps instead of a fixed k?
- What should the LLM layer do if a committed word turns out wrong in the final transcript?
- How does k interact with speculative LLM generation and cost?
- How would you handle punctuation and casing changes that are not real word changes?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
push_partial(text) returns newly committed words. A word is committed once it is in the common prefix of the last k partials. Committed words are final; finalize(text) flushes the rest of the fina...
High-Level Design
Keep a deque(maxlen=k) of tokenized partials. After each push, if the window is full, compute the LCP of all k lists. Anything in the LCP past the committed length is newly stable. If the window dis...