Engineering Decisions · Junior · Question 6 of 12
A badge shows unread notifications. They arrive a few times an hour, a one-minute delay is fine, and the hosting doesn't allow long-lived connections. What do you use?
- 1Polling a small endpoint once a minute
- 2A WebSocket held open for every signed-in user
- 3Server-Sent Events streamed to each open tab
Show the answer
Correct answer: Polling a small endpoint once a minute
Explanation
With rare events, a tolerated delay and no long-lived connections, plain polling is simple and works on any hosting. A WebSocket fits two-way, low-latency features such as chat, but it needs infrastructure that keeps connections open. Server-Sent Events fit one-way live updates like scores, yet they also rely on a long-lived connection, which this hosting rules out.