Design a Chat System
"Design a chat system," usually framed as Teams, is the design prompt Microsoft reaches for most after the rate limiter. The task sounds small. One person types a message, another sees it appear, ideally within a second. But that second person might be online with the app open, or away with the laptop shut and the phone in a bag. The system serves both, and the sender never knows or cares which. That split, online versus offline delivery, is the real problem hiding inside one sentence.
Start with rough numbers, because they pick the architecture. Microsoft hides exact figures, so hedge and round. Teams is used across a large share of the world's enterprises. Call it a few hundred million daily users sending on the order of tens of billions of messages a day. Spread evenly that's a few hundred thousand messages a second, and real traffic peaks several times higher when working hours overlap. At any moment a large fraction of those users have the app open, each holding a live connection to a server. So the system keeps on the order of a hundred million persistent connections at once. That connection count is what shapes everything else. A feed is read-heavy and you can precompute it. A chat system has to push a message to a specific recipient the instant it arrives, which means knowing exactly where that recipient is connected right now. Lead with the connection count. Everything else in the design bends around it.
MicrosoftPremium lesson · System design round
The Microsoft design, worked end to end.
- The API and data modelSystem design · Frequently asked
- The design, drawn out2 diagrams
- 5 deep divesWith the tradeoffs
$49 a year · all 100 companies · cancel anytime
From 1,382 Microsoft reports, forum threads behind logins and write-ups in Chinese.
Microsoft interview guideKnow what Microsoft asks before you walk in.
21 coding · 3 system design · 24 behavioral questions
Get their questions first.
InterviewLegend is independent and not affiliated with or endorsed by any company it covers.