Server-sent events deliver a server-to-client event stream over HTTP. Reconnection and event identifiers support continuity when used deliberately.
Before you start
You should understand clients, servers, IP addresses and ports. Follow a request through name resolution, connection establishment and application exchange. Distinguish protocol guarantees from deployment policy, and use observations from the relevant layer rather than guessing from one browser error message.
The practical goal is to reason through this situation: A job status page listens for progress and reconnects if the stream drops. Read the walkthrough first, then try the interview exercise before opening its answer. The important part is explaining the decision and its consequences, rather than remembering a definition alone.
Step-by-step walkthrough
Step 1: Define one-way updates
The server emits progress while ordinary HTTP handles commands.
Step 2: Carry event identity
Stable IDs can support deliberate resume behavior.
Step 3: Provide replay or snapshot
The server must retain enough history or offer a fallback.
Worked scenario
A job status page listens for progress and reconnects if the stream drops.
A progress stream drops after event 10. A reconnect can communicate its last event ID, but recovery succeeds only if the server honors it with retained events or a current snapshot. Proxy buffering may delay otherwise correct emissions, so observe actual delivery timing across the deployed path.
Common mistake
Transport reconnection alone does not prove every event was retained or replayed.
Verify the behavior
Test reconnect after retained and expired history and inspect proxy buffering.
Interview exercise
Design resumable status updates.
Answer and reasoning
Publish stable event IDs and define replay retention or snapshot fallback, accounting for proxy buffering.
Continue learning
Compare the scenario with the Networking interview questions and test your understanding with the Networking MCQs. For terminology and implementation details, consult the reference material.