Networking & HTTP · Trade-off
Real-time: WebSockets vs SSE vs long polling
Practise this out loud
Say your answer out loud to an AI interviewer that follows up, and get a score for it.
Practise by voiceThe interviewer asks
Live order tracking, a chat app and a stock ticker. Which transport for each, and why?
Then
Follow-ups the interviewer asks next
- Reconnect with backoff, heartbeats, resuming from a last event id.
- Scaling WebSockets (sticky sessions, pub/sub).
- Streaming
fetchwith a ReadableStream for LLM responses. - Battery and network on mobile.
The answer
What a strong answer covers
- Polling is simple and wasteful; SSE is server→client, over HTTP, with auto-reconnect; WebSockets are bidirectional and need more infrastructure
- Choose based on direction, frequency and infrastructure
The red pen
Common traps
Avoid:WebSockets for everything.
Practise this out loud
Say your answer out loud to an AI interviewer that follows up, and get a score for it.
Practise by voicePractise questions like this out loud
Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.