← Discord Interview Insights

Discord·Software Engineer·Onsite - System Design / Architecture·Staff

StaffPrefer not to say
May 2026Remote

Summary

Discord system design round for what felt like a senior-to-staff level engineering role. The whole thing was one big question about building a Slack-like messaging system, but they made it clear upfront that the real test was in the follow-up rabbit holes on indexing, storage choices, and fan-out. Walked out not totally sure how I did.

Questions Asked (4)

Q1

Design a Slack-style messaging platform supporting workspaces, public and private channels, DMs, threaded messages, mentions, search, presence indicators, and notifications.

System DesignTechnical Trade-offs
Author's notes

The surface area is massive so I tried to scope it fast and pick a few pillars to go deep on.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and scale (e.g., number of users, messages per day, latency needs) and then outline a high-level architecture covering core services like messaging, presence, and search. Dive into 2-3 critical components (e.g., message storage and delivery, fan-out for channels, search indexing) and discuss trade-offs (e.g., consistency vs. availability, push vs. pull for notifications).

Pro tip: Emphasize the unique challenges of real-time messaging at scale, such as ordering guarantees, exactly-once delivery, and handling offline users, and propose concrete solutions like using WebSockets for real-time and a message queue for reliability.

1. Clarify Requirements and Scale

Ask questions to understand functional and non-functional requirements: expected number of users, messages per second, latency targets, consistency needs, and features like message history and search.

2. High-Level Architecture

Sketch the main components: API gateway, WebSocket servers for real-time, message service, presence service, notification service, search service, and storage layers (e.g., databases, caches, queues).

3. Deep Dive into Critical Components

Choose 2-3 areas to detail, such as message storage and retrieval, fan-out for channels (push vs. pull), presence tracking, or search indexing, and explain design choices with trade-offs.

4. Address Scalability and Reliability

Discuss how to scale each component (e.g., sharding, replication), handle failures (e.g., retries, idempotency), and ensure low latency and high availability.

5. Summarize Trade-offs and Future Work

Recap key decisions and their trade-offs (e.g., consistency vs. latency, cost vs. performance) and mention potential improvements or open questions.

Key Points to Mention

  • Use WebSockets for real-time message delivery and fallback to long polling for compatibility.
  • Design message storage with a distributed database (e.g., Cassandra) for high write throughput and time-series partitioning.
  • Implement fan-out on write for channels with many members, but consider fan-out on read for large channels to avoid write amplification.
  • Use a presence service with heartbeats and a distributed cache (e.g., Redis) to track online status efficiently.
  • For search, use an inverted index (e.g., Elasticsearch) and consider per-workspace indexing for isolation and scalability.
  • Ensure message ordering and exactly-once delivery using sequence numbers and idempotent consumers.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q2

How would you index messages to support fast channel scrolling, full-text search, and unread counts?

System DesignData ModelingTechnical Trade-offs
Author's notes

This is where I felt most comfortable.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the scale and access patterns (e.g., millions of channels, billions of messages, read-heavy with occasional writes). Then propose a polyglot persistence strategy: a time-series store (e.g., Cassandra) for message storage and channel scrolling, an inverted index (e.g., Elasticsearch) for full-text search, and a counter store (e.g., Redis) for unread counts. Discuss trade-offs like consistency, latency, and cost, and how to keep indexes in sync.

Pro tip: Emphasize that unread counts should be maintained per user per channel using a distributed counter with idempotent updates, and that full-text search can be eventually consistent while scrolling must be strongly consistent. Also mention the importance of partitioning by channel ID to ensure efficient range queries.

1. Clarify requirements and scale

Ask about the number of channels, messages per channel, read/write ratio, latency requirements, and consistency needs. This will guide your indexing choices.

2. Design storage for channel scrolling

Use a wide-column store like Cassandra with partition key = channel_id and clustering key = message_id (time-ordered). This allows efficient range scans for scrolling.

3. Design full-text search indexing

Use a search engine like Elasticsearch. Index messages as they are written, possibly asynchronously via a message queue. Support per-channel and global search with filters.

4. Design unread count tracking

Maintain a per-user per-channel unread counter in a fast key-value store like Redis. Increment on new messages, reset on read. Use a last_read_message_id to compute unread counts if needed.

5. Address consistency and synchronization

Discuss how to keep indexes in sync (e.g., change data capture, dual writes with idempotency). Trade-offs: eventual consistency for search vs. strong consistency for scrolling and unread counts.

Key Points to Mention

  • Partitioning by channel_id for efficient range queries
  • Time-ordered message IDs (e.g., Snowflake) for scrolling
  • Inverted index for full-text search (e.g., Elasticsearch)
  • Distributed counters for unread counts (e.g., Redis)
  • Asynchronous indexing via message queue for search
  • Trade-offs: consistency, latency, cost, and complexity

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q3

Walk through your database choice for storing messages: relational, NoSQL, or a log-plus-KV split. How would you partition by workspace or channel?

System DesignData ModelingTechnical Trade-offs
Author's notes

I went with a log-structured approach, something like Cassandra or a custom append-only store partitioned by channel_id, with a separate KV layer for metadata and counters.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the access patterns and scale requirements (e.g., message volume, read/write ratio, latency, retention) before comparing options. Then propose a hybrid architecture: a log-based store for the message stream and a KV store for fast lookups, with partitioning by channel ID (or workspace ID) to distribute load. Explain how this handles Discord's scale and real-time needs.

Pro tip: Emphasize that the choice is driven by access patterns, not technology trends—show you understand the trade-offs between consistency, latency, and operational complexity. Mention that Discord's actual architecture uses a similar hybrid approach (e.g., Cassandra for messages, Redis for presence) to demonstrate domain awareness.

1. Clarify Requirements

Ask about scale (messages per second, total storage), read/write patterns (e.g., recent messages vs. history), latency requirements, and consistency needs. This shows you don't jump to solutions.

2. Evaluate Options

Compare relational (strong consistency, but scaling challenges), NoSQL (horizontal scale, tunable consistency), and log+KV (high write throughput, fast reads). Highlight trade-offs in terms of partitioning, replication, and query flexibility.

3. Propose Hybrid Architecture

Recommend a log-based store (e.g., Kafka or Cassandra) for the immutable message stream and a KV store (e.g., Redis or ScyllaDB) for indexing and fast retrieval. Explain how they complement each other.

4. Design Partitioning Strategy

Partition by channel ID (or workspace ID) to ensure even distribution and locality. Discuss sharding, replication, and how to handle hot partitions (e.g., large channels) with techniques like time-based bucketing.

5. Address Trade-offs and Failure Modes

Discuss consistency vs. availability (e.g., eventual consistency for messages), handling of out-of-order writes, and disaster recovery. Show awareness of operational complexity.

Key Points to Mention

  • Access patterns: write-heavy, read recent messages, occasional history queries.
  • Partitioning by channel ID or workspace ID to distribute load and enable efficient queries.
  • Use of log-structured storage (e.g., Kafka, Cassandra) for high write throughput and durability.
  • KV store (e.g., Redis) for fast lookups and caching of recent messages.
  • Trade-offs: consistency vs. latency, operational complexity, cost.
  • Handling hot partitions and scaling with techniques like time-based sharding or consistent hashing.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q4

Describe the fan-out path for a sent message: how does it reach all channel members, including offline users and mobile push, and how do unread counts get updated along the way?

System DesignTechnical Trade-offsAPI & Integrations
Author's notes

I split it into online vs offline pretty early.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Walk through the end-to-end message flow starting from the sender's client to the recipient's devices, emphasizing the role of the gateway, message service, and fan-out service. Highlight how the system handles online vs. offline users, mobile push notifications, and unread count updates, while discussing trade-offs like consistency vs. latency.

Pro tip: Mention that Discord uses a hybrid approach: real-time delivery via WebSocket for online users and push notifications for offline, with unread counts managed per-channel and synced across devices using a versioned read state. This shows awareness of practical constraints at scale.

1. Message Ingestion

Describe how the sender's message is received by the API gateway, validated, and persisted to the message store (e.g., Cassandra or ScyllaDB) with a unique message ID and timestamp.

2. Fan-out to Online Users

Explain that the fan-out service retrieves the channel's member list (possibly from a cache) and publishes the message to each online user's WebSocket connection via a pub/sub system like Redis or a custom event bus.

3. Handling Offline Users & Mobile Push

For offline users, the system enqueues a push notification (e.g., via APNs/FCM) and stores the message in their inbox for later retrieval. Mention that mobile push may be throttled or batched to avoid spamming.

4. Unread Count Updates

Unread counts are updated per user per channel, often using a read-state service that tracks the last-read message ID. When a message is delivered, the count is incremented; when the user reads, it's reset. This state is synced across devices.

5. Trade-offs & Optimizations

Discuss trade-offs: fan-out on write vs. read, consistency of unread counts, and handling large channels (e.g., thousands of members) with techniques like sharding or lazy fan-out.

Key Points to Mention

  • Use of WebSocket connections for real-time delivery to online users.
  • Message persistence and ordering guarantees (e.g., per-channel sequence numbers).
  • Push notification services (APNs/FCM) for offline mobile users, with potential batching.
  • Unread count management using a read-state service and last-read message ID.
  • Scalability considerations: fan-out service, pub/sub, and caching member lists.
  • Trade-offs between consistency and latency, especially for unread counts across devices.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.