This question evaluates system design and real-time distributed systems skills, including designing scalable chat architectures that support 1:1 and group conversations, WebSocket-based delivery and routing across multiple gateway servers, message persistence and history sync, multi-device consistency and read receipts, plus the ability to define, detect and optimize for the Top N "hot" group chats. Commonly asked to assess reasoning about high-level architecture, concrete data schema and indexing, routing and state synchronization, and availability/disaster-recovery trade-offs, it tests both conceptual understanding and practical application by requiring a clear architecture together with detailed data model and scalability/performance considerations.
Design a real-time chat system (similar to an in-app messaging feature) that supports:
Additional requirement:
The interviewer expects particular attention to: