Design a Slack-Like Messaging Platform
Company: Crusoe
Role: Software Engineer
Category: System Design
Difficulty: easy
Interview Round: Onsite
##### Question
Design a Slack-like team messaging platform that serves millions of daily active users with low-latency delivery across multiple regions. Walk through requirements, high-level architecture, data model, APIs, the real-time delivery path, and the key reliability/scaling trade-offs.
Your design should cover:
1. **Core conversation model**: workspaces/organizations, channels (public/private), one-to-one direct messages, and group chats with many members.
2. **Messaging**: send, receive, edit, and delete messages; per-conversation ordering guarantees; deduplication and retries.
3. **Real-time delivery**: deliver messages to online users in real time (e.g., over WebSockets), and the fanout strategy for small vs. very large channels/groups.
4. **Offline handling**: offline delivery, push notifications, and how a client catches up after being offline or after a reconnect.
5. **History**: message history retrieval and pagination, plus multi-device sync.
6. **File sharing**: file upload, download, preview, and sharing inside conversations.
7. **Common collaboration features** (prioritize and justify): threading, reactions, @mentions, full-text search, presence/typing indicators, and retention.
8. **APIs**: write/send, read/history, subscribe/stream, and search.
9. **Data model and storage choices**, including how messages are partitioned and ordered.
10. **Non-functional requirements**: low-latency delivery, scalability to large workspaces and channels, high availability, multi-device consistency, multi-region deployment, security, and access control.
11. **Operational concerns**: monitoring, backpressure, and abuse/rate limiting.
Quick Answer: This question evaluates a candidate's competency in designing scalable, low-latency distributed messaging architectures, covering conversation modeling, per-conversation ordering and idempotency, real-time and offline delivery, history and pagination, file handling, APIs, data partitioning, multi-region consistency, security/ACLs, and operational concerns. As a System Design domain prompt, it is commonly asked to probe trade-offs between consistency, availability, latency, and scale while assessing both conceptual architectural reasoning and practical application details such as APIs, data models, deployment, monitoring, and backpressure handling.