Loading...
Loading...
Module 14 · 1 chapters
Choosing WebSockets is the easy half of a real-time answer. The half that earns the offer is what happens when the socket drops, the tab sleeps, messages arrive twice, or the user goes offline mid-send.
This module compares polling, long polling, SSE, and WebSockets, then works through the client-side reliability layer every chat and live dashboard needs.
You will learn exponential backoff with jitter on reconnect, heartbeat and ping/pong dead-connection detection, monotonic sequencing for ordering, idempotent client message IDs for deduplication, and gap-fill resync via a REST catch-up call.
It finishes with offline behavior: outbox queues, optimistic message states (sending, sent, failed), conflict handling, and how Service Workers and IndexedDB keep the UI usable without a network.
Phase 8 (Week 8) of the interview roadmap. Senior Track spans modules 1–19; the Staff Track starts at module 20.