Design a real-time chat app

hard

Complete guide with examples and interview questions · 45 min

Definition

Say it out loud in an interview — clear, simple, no textbook wording.

If someone asks me to design a chat app, I would say it is a message list where sending feels instant, order is guaranteed by the server, and reconnects lose nothing. The chat window looks like the simplest UI in the world. The hard parts are all invisible: optimistic updates, ordering, delivery states, and resume.

Interviewers care because chat punishes every async shortcut. No cancellation story, no ordering story, and no reconnect story all show up as duplicated messages, lost messages, or a list that jumps while you read it.

The senior nuance is honesty about delivery. A message can be sent, delivered, and read, and those are three different states. A design that shows one checkmark for all three is lying to the user, and interviewers notice.

Quick Stats
45
Minutes
hard
Difficulty
5
Interview Q's

Key takeaways

  • Optimistic send is what makes chat feel instant: render first, confirm after
  • Message order needs server sequence numbers, not client timestamps
  • Reconnect must resume from a cursor, or messages get lost or duplicated
  • Read receipts and typing indicators are presence state, not message content
  • A chat list is a virtualized list with one more problem: it grows at the bottom

Track your mastery

Sign in to save Q&A scores, coding challenge progress, points, and streaks across devices.

Sign in to save progress