InterviewLegend

Design Presence at Scale

Commonly asked
Alex Chen45 min readUpdated 327 real interview reports

Presence is the small colored dot next to a name, but the system behind it is a fan-out problem at consumer scale. A single user flipping from online to idle can matter to their friends and to every member of every server they share. Discord serves hundreds of millions of accounts, with millions connected at once. Presence is one of the canonical Discord design surfaces, and it makes a good interview question because the naive version quietly explodes. Push every status change to everyone who might care, and a member of a 200,000-person server generates 200,000 messages for one idle timeout. The interesting design is entirely about not doing that.

The Discord angle
Presence is a payload that rides the same real-time gateway that already delivers messages, so reuse the gateway's fan-out instead of reinventing it. Every Discord client already holds one persistent WebSocket to the gateway. A session process on the BEAM virtual machine represents the connection, and a guild process represents each server. Messages fan out through that fabric, and presence takes the exact same path. A status change is published to the connected sessions that should see it, using the same relays that already cut work for large servers. A candidate who designs a separate presence service with its own connections has doubled the hardest part of Discord's architecture. Say early that presence is coupled to the gateway and reuses its session, guild, and relay machinery, and you have shown you understand how the pieces fit rather than reciting a status-table CRUD design.

DiscordPremium lesson · System design round

The Discord design, worked end to end.

  1. The API and data modelSystem design
  2. The design, drawn out1 diagram
  3. 5 deep divesWith the tradeoffs
Get the Discord questions

$49 a year · all 100 companies · cancel anytime

From 327 Discord reports, forum threads behind logins and write-ups in Chinese.

Had your Discord interview?Tell us what they asked. Reviewed before it goes in, never with your name.
Discord interview guide

Know what Discord asks before you walk in.

28 coding · 6 system design · 19 behavioral questions

Get Premium$49 a year · Cancel anytime
Or start freeNo card.

Get their questions first.

InterviewLegend is independent and not affiliated with or endorsed by any company it covers.