All Questions
Ai Coding And Product Systems hard

Your chat app streams responses over SSE. Mobile users switching between Wi-Fi and cellular often drop mid-response. The client retries by resending the prompt, which regenerates from scratch, doubles GPU cost, and produces a different answer. What is the best fix?

  1. A Switch from SSE to WebSockets, since a persistent bidirectional socket survives mobile network changes without reconnecting.
  2. B Decouple generation from the connection: buffer tokens per message ID and let clients resume from the last received event ID.
  3. C Disable streaming on mobile and return the full response on completion, so a dropped request can simply be retried idempotently.
  4. D Lower max output tokens for mobile clients so most responses finish before a typical network handoff interrupts the stream.

One system design question a day, with spaced repetition so the ones you miss come back.

Get the app

Related questions