Design a broadcast channel like Telegram
PremiumReal-timeMedium
- Fan out
- Pub sub
- WebSocket
Quick answer
This real-time interview question asks you to design a broadcast channel like Telegram. 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 the broadcast side of a messaging app like Telegram channels: one publisher posts, and up to 5 million subscribers must see the message. Online subscribers get it within about 2 seconds; offline subscribers get it in order when they come back.
A channel has one or a few publishers, and subscribers never reply inside the channel. The hard part is one post reaching up to 1.5 million open connections inside that window without one database write per subscriber.
What must a broadcast channel like Telegram do?
- Publish: A publisher posts a text or media-link message to a channel. The message gets a channel-scoped increasing sequence number.
- Live delivery: Every online subscriber receives the message on their open connection.
How well must it do it?
- Latency: 95% of online subscribers receive a post within 2 seconds; 99% within 5 seconds.
- Ordering: No subscriber ever sees message n+1 before message n within one channel.
What scale should you design for?
Use these numbers in your estimates.
The scale numbers unlock with this questionUnlock
Key concepts
- Fan out
- Pub sub
- WebSocket
- Connection sharding
- Backpressure
- Offline catch up
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 a broadcast channel like Telegram and explain your choices the way you would in an interview.
- Is this question asked at entry level?
- It is marked Medium. Entry-level engineers can practise it, but it expects you to reason about requirements and trade-offs, not only list components.
- 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