Real-Time and Streaming System Design Questions

Designing client-facing, always-on live delivery systems: real-time communication transports (WebSockets, server-sent events, long-polling, WebRTC, MQTT), connection lifecycle and scaling for millions of persistent connections, presence, pub/sub fan-out to online users, chat and notifications, live feeds and tickers, real-time collaboration (CRDT vs OT, offline sync and reconciliation), and live and on-demand video delivery (ingest, transcoding, adaptive bitrate, CDN delivery, low-latency protocols, playback entitlement and content protection). Covers latency budgets, per-client ordering, delivery guarantees across disconnect and reconnect, per-client backpressure, capacity estimation for connection fleets, authentication, authorization, and revocation for real-time channels and premium content, and operational readiness (SLOs and error budgets, observability and incident response, rate limiting, safe rollout, and load and chaos testing) for live-delivery platforms. Data-pipeline stream processing (Kafka or Flink jobs, windowed aggregation, exactly-once pipelines, real-time analytics ingestion) is out of scope.

EasyTechnical
55 practiced

Describe the lifecycle of a persistent real-time connection (for example a WebSocket), from handshake through termination. Cover authentication during connection establishment, keepalive/heartbeat strategies (client and server), detecting stale or half-open connections and NAT timeouts, graceful shutdown, and typical timeout values and trade-offs for mobile versus desktop environments.

EasyTechnical
52 practiced

Explain the WebSocket opening handshake and how it differs from a typical HTTP request/response flow. Compare WebSocket with HTTP/2 server push and SSE in terms of compatibility with HTTP proxies, TLS termination, connection upgrade requirements, and failure modes when intermediaries interfere. Describe practical mitigations for proxy or firewall incompatibilities.

EasyTechnical
44 practiced

You need to implement a live, high-fan-out feed (for example a live sports score or a real-time dashboard) that is mostly one-way, server-to-client, and must reach up to 100k concurrent clients with low latency. Between SSE and WebSockets, which would you choose and why? Consider scalability, proxies/CDNs, mobile clients, TLS, automatic reconnection behavior, and how you would implement efficient fan-out to many clients.

EasyTechnical
94 practiced

Write pseudocode (or JavaScript) for a client-side optimistic UI update when sending an update over a realtime channel. The function should: apply change locally, enqueue the outbound operation with a temporary client-generated ID, send the update to the server, handle ACK/NACK/conflict responses, and roll back or reconcile the local state accordingly. Explain idempotency considerations for retries.

MediumTechnical
65 practiced

Implement an exponential backoff reconnection algorithm in Python for a WebSocket client. The function should return the next retry delay given attempt number, a base_delay_ms, a max_delay_ms, an optional jitter flag to add ±10% random jitter, and a cap for maximum attempts. Provide runnable or clear pseudocode and explain how jitter prevents thundering-herd effects.

Unlock Full Question Bank

Get access to all 12 Real-Time and Streaming System Design interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.