All Questions
Real Time Updates hard

A user loses connection for 5 seconds. In a standard WebSocket implementation, the messages sent during that time are lost. How do you implement 'At-Least-Once' delivery for a chat app?

  1. A Rely on TCP retransmission.
  2. B Send messages twice.
  3. C Use a bigger buffer.
  4. D Implement an 'Ack & Replay' buffer. The server keeps sent messages in a list until the client sends an application-level 'ACK(ID)'. On reconnect, the client sends 'Last-ID=5', and server replays 6+.

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

Get the app

Related questions