Try
↑ ↓ move↵ openesc close

Interview prep / Chat system

Senior · Chat system · System design interview question

How do you deliver messages to a user who is offline?

Sketch your own answer first, then compare it with the one below.

A strong answer

Store each message first and treat the push to the connection as an optimisation. If the user has no connection, nothing else is needed.

On reconnect the client reports the last sequence number it holds for each conversation. The server returns everything after it, in order. This is the same range read as history, so there is no per-user queue.

For a phone with the app closed, send a small notice through the platform push service and let the app fetch by sequence number.

Sources

Learn it by running it

The design a chat system lesson explains the mechanism behind this question, and its lab lets you change the parameters and watch the effect.

Your progress is saved in this browser. Sign in to keep it on every device. Privacy · Terms