Code Room
System designHardsd-g520
Subject WebsocketsLevel Senior–Staff~45 minCommon in Networking & APIs interviewsIndustries Technology, Software development

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.

Narrate your design
Loading whiteboard…
Run or narrate your approach, then ask the coach.