PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/System Design/Discord

Design a TCP Discord-like chat server

Last updated: Jun 2, 2026

Quick Overview

This question evaluates a candidate's skills in system design, TCP-based protocol design, real-time messaging, data modeling, persistence, session/reconnection handling, and concurrency control for backend services.

  • medium
  • Discord
  • System Design
  • Software Engineer

Design a TCP Discord-like chat server

Company: Discord

Role: Software Engineer

Category: System Design

Difficulty: medium

Interview Round: Onsite

Design a Discord-like chat server that accepts multiple clients over raw TCP (e.g., test via PuTTY/telnet). Functional requirements: - Clients connect over TCP and can send line-based messages. - Support slash commands: - `/help` show available commands - `/nick <name>` set/change nickname - `/users` list users (at least in current room, or globally—state your choice) - `/quit` disconnect - Chat rooms: - Create rooms, join rooms, and list rooms - Messages sent to a room are broadcast to all users currently in that room - Reconnection: - If a client disconnects and later reconnects (identify how), they should be able to rejoin their previous rooms - Message history: - When a user joins a room, show the last 10 messages from that room - Persistence: - Data must persist across server restarts (users/rooms/membership/messages as needed) Non-functional requirements: - Keep scalability in mind (multiple concurrent clients; discuss how to scale beyond one process/host). Explain your protocol, core data model, key components, and how you would handle concurrency, durability, and scaling.

Quick Answer: This question evaluates a candidate's skills in system design, TCP-based protocol design, real-time messaging, data modeling, persistence, session/reconnection handling, and concurrency control for backend services.

Related Interview Questions

  • Design a Local Leader Election System - Discord (medium)
  • Design Video Call Analytics Tables - Discord (hard)
  • Design Slack-like chat system - Discord (easy)
  • Design leader election using Redis leases - Discord (medium)
Discord logo
Discord
Jan 27, 2026, 12:00 AM
Software Engineer
Onsite
System Design
23
0

Design a Discord-like chat server that accepts multiple clients over raw TCP (e.g., test via PuTTY/telnet).

Functional requirements:

  • Clients connect over TCP and can send line-based messages.
  • Support slash commands:
    • /help show available commands
    • /nick <name> set/change nickname
    • /users list users (at least in current room, or globally—state your choice)
    • /quit disconnect
  • Chat rooms:
    • Create rooms, join rooms, and list rooms
    • Messages sent to a room are broadcast to all users currently in that room
  • Reconnection:
    • If a client disconnects and later reconnects (identify how), they should be able to rejoin their previous rooms
  • Message history:
    • When a user joins a room, show the last 10 messages from that room
  • Persistence:
    • Data must persist across server restarts (users/rooms/membership/messages as needed)

Non-functional requirements:

  • Keep scalability in mind (multiple concurrent clients; discuss how to scale beyond one process/host).

Explain your protocol, core data model, key components, and how you would handle concurrency, durability, and scaling.

Solution

Show

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More System Design•More Discord•More Software Engineer•Discord Software Engineer•Discord System Design•Software Engineer System Design
PracHub

Master your tech interviews with 8,000+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.