The Zombie Socket Reaping
#sev1 — Flash Sale WebSocket server EMFILE / OOM
SRE: 50,000 clients in clients Set — only ~5,000 actually bidding. Mobile TCP dies silently (no close frame). Server broadcasts to 45,000 zombie sockets until crash.
The trap: Persistent ≠ permanent. Trust TCP and you hoard dead connections.
Your task
Fix `RealTimeServer` in `ws_server.js`: pongListener in addClient() + heartbeat reaper in runHeartbeatCheck().
Book: add socket to array · Prod: ping/pong heartbeat — terminate on missed pong.
Skills you'll prove
Interview Tip
When asked about WebSockets or real-time systems, say: "Persistent doesn't mean permanent. I debugged a flash-sale server that crashed with EMFILE because 45,000 mobile clients were dead in pockets — TCP dropped without a close frame, but they stayed in our clients Set. The fix was application-level heartbeats: mark isAlive false, send ping, terminate on missed pong. Same pattern as the ws library's native ping/pong and Socket.io's heartbeat. Never trust the TCP layer for long-lived mobile connections."