Design a real-time messenger
Company: Meta
Role: Software Engineer
Category: System Design
Difficulty: hard
Interview Round: Onsite
Design a real-time messaging system that supports 1:1 and group chats, multi-device sync, presence/typing indicators, read receipts, media attachments, and message search. Define APIs (SendMessage, Sync, Ack, FetchHistory, SubscribePresence), message IDs and ordering, delivery semantics (at-least-once with deduplication), and offline storage/sync. Propose an architecture with gateways, real-time fanout (e.g., WebSockets), message persistence, indexing, and cold storage tiering to support 100M MAU, 10M DAU, and p99 send-to-receive latency under 150 ms. Discuss partitioning by user/conversation, exactly-once UX, backfill and out-of-order handling, end-to-end encryption options, abuse/spam mitigation, rate limits/quotas, retention/TTL, GDPR deletion, and observability.
Quick Answer: This question evaluates system-design and distributed-systems competencies for building a large-scale, low-latency real-time messaging platform, covering topics such as real-time protocols, delivery semantics, multi-device synchronization, data partitioning, persistence and search, and privacy/security considerations.