AI Application Integration · 3 to 4 hours
Design a resilient streaming chat
Design a streaming interview-practice chat that keeps one answer correct across reconnects, several open tabs, and cancellation races, checks citations against current access, and never repeats its booking tool during recovery.
4 h
Used in interview rounds:
AI System Design (Hard)1
Step 1: The question
Using the interview-practice chat scenario, design the chat's submission, streaming, reconnect, cancellation, citation, and fallback behavior. Explain the durable identities, event replay and snapshot consistency, cancellation races and the booking tool, multi-tab behavior, authorization, and accessibility. Finish with the fault-injection tests that would verify recovery.
Constraints
- Several tabs of one conversation can be open at once, and connections drop or are buffered by proxies
- Losing a connection must not start a new model request, and the booking tool must not run twice
- Every run lookup, event subscription, cancellation, and citation fetch is authorized against current access
- The tool executor's operation idempotency is given by Tool Calling & Agents Hard; do not redesign it
- The transcript works with a keyboard and a screen reader, and there is a non-streaming fallback
Deliverables
- Durable records and identities, including idempotent submission and the conversation revision each run accepts
- The reconnect protocol: cursor, replay, duplicate and gap handling, and the snapshot-to-live handoff
- The cancellation contract, the rule for competing terminal states, and how recovery treats the booking operation
- Citation resolution and access checks, the fallback path, and the accessible status design
- Fault-injection tests, each with the invariant it checks
Hard questions are part of Premium: the study guide, reference answer, rubric, and exercises unlock with Premium.
