Design Slack-like chat system
Company: Discord
Role: Software Engineer
Category: System Design
Difficulty: easy
Interview Round: Onsite
## System design: Slack/Discord-like chat
Design the **chat subsystem** for an app like Slack/Discord.
### Product requirements
- The product has **workspaces**. Each workspace contains **channels**.
- Users can **join workspaces** and view all channels in that workspace.
- Users can send **plain-text messages** in any channel they have access to.
- Users can also have **1:1 private chats (DMs)**.
- Users can **scroll back and read the full message history** (assume no expiration).
- Users should **see new messages without refreshing** (real-time updates).
- Anticipated top feedback: support **editing and deleting messages**.
### What to cover
- Core APIs (send message, fetch history, subscribe for real-time, edit/delete)
- Data model and storage
- Real-time delivery approach
- Ordering/consistency expectations
- Scaling considerations and key trade-offs
You may assume typical Slack-like scale (many workspaces, many channels, high fanout).
Quick Answer: This question evaluates skills in designing scalable, real-time chat systems, including distributed systems, data modeling, API design, message ordering and consistency, and real-time delivery mechanisms.