Skip to main content
InterviewHubPRO
Section Overview
Q14

Question 14 of 50

Part 2: Core Architecture & Implementation (Mid-Level)

28%
Networking & Protocols (50 Qs)•Part 2: Core Architecture & Implementation (Mid-Level)

What are Server-Sent Events (SSE) and when should you choose SSE over WebSockets?

senior LevelSystem Design

In Simple Words: SSE provides unidirectional real-time streaming from Server to Client over standard HTTP:

  • Sent with Content-Type: text/event-stream.
  • Browser natively handles auto-reconnection via the EventSource JavaScript API.
  • Why Choose SSE over WebSockets:
    • LLM AI chat streaming (ChatGPT text completion), live stock tickers, notification feeds.
    • Simpler infrastructure: operates over standard HTTP/2, works through standard corporate proxies and firewalls without special WebSocket handling.