Design a real-time chat system (similar to an in-app messaging feature) that supports:
-
1:1 and group conversations
-
Real-time delivery over WebSockets (or equivalent)
-
Message persistence and history sync
-
Read receipts (at least per-user “last read”)
-
Multi-device users (same user logged in on multiple clients)
-
High availability / disaster recovery considerations
Additional requirement:
-
The system must
optimize for the Top N “hottest” group chats
(e.g., groups with extremely high message throughput and/or many concurrently online participants). Explain what “hot” means and how you detect it.
The interviewer expects particular attention to:
-
A clear high-level architecture
-
A concrete
data schema
(tables/collections, keys, indexes)
-
How messages get routed when you have
multiple WebSocket gateway servers
-
Scalability and performance trade-offs