Networking & Protocols
WebSocket: free-recall review
Retrieval beats re-reading. For each prompt, say or write a full answer from memory before you open the model answer — the effort of recall is what makes the unit stick.
Reconstruct the unit’s spine — the upgrade, framing and masking, transport choice, backpressure, jittered reconnection, and the scaling ceilings — without looking back at the lessons.
- 01Why does WebSocket upgrade an existing HTTP connection instead of opening a fresh raw TCP socket, and what happens on the wire right after the 101?
- 02Why must client-to-server frames be masked while server-to-client frames must not be?
- 03Give two cases where SSE is the better default than WebSocket, and one case where only WebSocket will do.
- 04Walk through the backpressure failure mode on a broadcast server and the high-water-mark fix.
- 05Why does exponential backoff without jitter still cause a thundering herd, and what is the correct reconnection recipe?
- 06Name the three independent ceilings on connections per WebSocket server, and how horizontal scale and HTTP/2 extended CONNECT shift them.
If you could reconstruct each answer from memory, you hold the unit’s spine: the upgrade reuses the existing connection so infrastructure still routes it; masking defends the wire against cache poisoning; transport choice follows the direction of data flow; backpressure is the canonical OOM, capped by a high-water mark; reconnection must be jittered or it becomes a thundering herd; and scale hits RAM, file descriptors, and NIC ceilings that HTTP/2 multiplexing and pub/sub fan-out push outward.