KatInterview

Message Status Tracking in a Chat Application

System DesignModel answer
MediumModel answerSystem Designdistributed-systemsreal-timescalability

Last updated

Build the infrastructure for tracking and displaying message state (sent, delivered, read) in a messaging platform serving millions of users.

You're designing the status-tracking subsystem for a messaging platform. When a user sends a message, the UI must reflect three sequential states: acknowledged by infrastructure, received on the recipient's client, and opened by the recipient. Updates should appear immediately when both parties have connectivity, and synchronize correctly after either party reconnects.

Scope

  • The underlying messaging infrastructure exists: clients maintain long-lived server connections, and messages persist until acknowledged by receiving devices. You're adding the status layer on top.
  • Begin with direct messaging between two users; extend to multi-participant conversations once the foundation is clear.
  • This platform operates at significant scale, making status traffic one of the highest-volume data flows.

Requirements

  • Status progresses in one direction only: once marked as opened, a message cannot revert to merely delivered.
  • You should define reasonable traffic assumptions since none are provided.
  • Consider but don't assume answers for: privacy controls, multiple simultaneous sessions per account, and end-to-end encryption.

Discussion Points

  • For group conversations, should senders see individual member status, aggregated status ("seen by all"), or both views?
  • If users disable read confirmations, does that also hide others' confirmations from them?
  • When one account has multiple active sessions, does reading on any session count universally?
  • With end-to-end encryption, what can the server observe?
  • After extended disconnection, how quickly must status synchronize when a user returns?
  • What user base size and message volume should drive the design?

Hints

Hint 1

Think about what each device sends and when: the recipient's client knows when messages arrive and when the user views them, but how does that information travel back?

Hint 2

High volume means millions of status updates per second. Consider batching, watermarks ('read through message X'), and whether every state transition needs separate tracking.

Hint 3

Group chats amplify everything: one message to 100 members could mean 200 status events (delivered + read) per member. How do you prevent fan-out explosion?