CloudSketch AI Logo
FeaturesTemplatesPricingEnterpriseAboutContactLog in
πŸŒ™β˜€οΈ
Log inStart free
Home/Templates/System Design Interview Classics

πŸ“ System Design Interview Classics Β· Sequence

Chat App Message Delivery (WhatsApp-style)

How a one-to-one chat message is delivered in a WhatsApp-style system, with sent, delivered and read ticks, and push notifications when the receiver is offline.

More System Design Interview Classics templates

Drawing diagram…

What this diagram shows

  • Messages go over persistent WebSocket connections
  • Offline users get a push notification and messages wait in storage
  • Ticks come from delivery and read acknowledgements

Prompt used

Chat message sequence: Alice's app sends a message over its WebSocket to chat server 1, which stores it in Cassandra and acknowledges (one tick). The presence service says which server Bob is on. If Bob is online, chat server 2 delivers it and Bob's app acknowledges (two ticks). If Bob is offline, a push notification is sent and the message is delivered when he reconnects. When Bob opens the chat a read receipt goes back (blue ticks).

Mermaid code
sequenceDiagram
  actor A as Alice
  participant CS1 as Chat Server 1
  participant DB as Message Store
  participant PR as Presence Service
  participant CS2 as Chat Server 2
  participant PN as Push Service
  actor B as Bob
  A->>CS1: Send message over WebSocket
  CS1->>DB: Store message
  CS1-->>A: Sent - one tick
  CS1->>PR: Where is Bob?
  alt Bob online
    PR-->>CS1: On Chat Server 2
    CS1->>CS2: Forward message
    CS2->>B: Deliver
    B-->>CS2: Delivered ack
    CS2-->>A: Delivered - two ticks
  else Bob offline
    PR-->>CS1: Offline
    CS1->>PN: Send push notification
    PN-->>B: New message alert
  end
  B->>CS2: Opened chat
  CS2-->>A: Read - blue ticks

Related templates

C4 ArchitectureProSystem Design Interview Classics

URL Shortener System Design

The classic interview design for a service like bit.ly: short code generation, fast redirects from a cache, and click analytics processed separately.

Data FlowSystem Design Interview Classics

Social News Feed (Twitter-style)

How posts reach followers' feeds: fan-out on write for normal users, fan-out on read for celebrities, and a ranked feed built from a cache.

C4 ArchitectureProSystem Design Interview Classics

Ride Matching System (Uber-style)

The core of a ride-hailing app: drivers stream their locations, a geo index finds nearby drivers, and a matching service offers the trip to the best one.

FlowchartSystem Design Interview Classics

API Rate Limiter (Token Bucket)

How a token bucket rate limiter decides whether to let an API request through, using Redis so all servers share the same counts.

DeploymentProSystem Design Interview Classics

Notification Service Design

A notification system that sends email, SMS and push messages at scale: one API, a queue per channel, user preferences, and retries.

Data FlowSystem Design Interview Classics

Search Autocomplete (Typeahead)

How search suggestions appear as you type: a prefix index built offline from past searches, served from memory, and refreshed regularly.