Design presence and typing indicators
PremiumReal-timeEasy
- Presence
- Typing indicators
- Heartbeats
Quick answer
This real-time interview question asks you to design presence and typing indicators. Aim for a design that delivers updates to many users with low delay, then explain connections, fan-out, ordering and trade-offs. Interviewers want to see how you keep latency low, handle reconnects and stay correct under load.
The problem
Design presence (online, away, offline, last seen) and typing indicators for a messaging app like WhatsApp or Slack. The hard part is keeping status accurate for 25 million online users without a write or broadcast per heartbeat or keystroke.
Presence is shown next to contacts and in conversation headers; the typing indicator appears in a conversation while another participant is typing. Both are ephemeral: nobody needs a history, but stale state is annoying (a friend shown online for an hour after closing the app) and chatty state is expensive (every keystroke to every participant).
What must the system do?
- Status: A user is online when a device has an active connection, away after 5 minutes without activity, and offline when no device is connected. Offline users show a "last seen" time rounded to the minute.
- Typing: When a user types in a conversation, other participants see "X is typing" within 1 second; it disappears within 3 seconds after they stop.
How well must it do it?
- Freshness: Status changes propagate within 5 seconds; an unexpected disconnect (crash, lost network) is reflected within 60 seconds.
- Cost: Presence must not become the biggest write load in the system; typing must not generate one event per keystroke.
What scale should you design for?
Use these numbers in your estimates.
The scale numbers unlock with this questionUnlock
Key concepts
- Presence
- Typing indicators
- Heartbeats
- TTL expiry
- Pub sub
- Debouncing
How you’ll practise
- Requirements
- Estimate
- Connections
- Message flow
- Delivery guarantees
- Wrap-up
Lala, personalized to you, gives a hint when you ask and reviews your design when you are ready.
What do interviewers look for?
In any real-time design round.
- Clarifies latency, ordering and delivery guarantees
- Chooses a connection model with reasons
- Explains fan-out to many receivers
- Handles reconnects, missed messages and duplicates
- Plans for hot spots and sudden traffic spikes
- States trade-offs between consistency and speed
Questions people ask about this interview question
- Which design type is this question?
- It is a real-time question. You design presence and typing indicators and explain your choices the way you would in an interview.
- Is this question asked at entry level?
- It is marked Easy, so it suits engineers who are new to real-time interviews. It is also a good warm-up before harder questions.
- What should I cover first?
- Start with who sends and receives updates, how fast they must arrive and what order matters. Agree on scope with the interviewer before you design anything.
- Can I practise it for free?
- It is a premium question. Sign up and unlock it once for 10 credits; it then stays unlocked. When you finish, Lala, your personalized AI mentor, can review your design for 30 credits.
Related questions
Updated · Written by the SevyDevy team