Code Room
System designHard
Question
Design the WebSocket gateway tier for a platform with 10M concurrent persistent connections. Requirements: route a message destined for user U to whichever gateway node holds U's socket; survive node restarts/deploys without dropping all connections at once; handle reconnect storms (a deploy or network blip reconnects millions at once); and keep per-connection memory low. Messages must not be lost across a brief reconnect.
What a strong answer looks like
Clarify scale and constraints first. Propose a clean component breakdown, then go deep on the hard parts — data model, bottlenecks, consistency, failure modes — and name the trade-offs you are making.
Learn the concepts
Loading whiteboard…
Run or narrate your approach, then ask the coach.