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.

MediumTechnical
65 practiced

Design the notification strategy for offering drivers new ride requests in a large-scale dispatch platform. Compare push (server-initiated) and pull (driver-initiated polling) delivery, weighing latency, battery and network cost, and scalability, and address the risk that a push-heavy strategy can systematically over-expose offers to the same subset of drivers. Propose a hybrid delivery approach and explain when each mode should be used.

MediumTechnical
45 practiced

Draft a reconnection strategy for mobile clients connecting to a WebSocket real-time service that enforces server rate limits and must minimize battery usage. Include exponential backoff with jitter, maximum retry windows, progressive decay, fallback strategies to polling, and metrics to determine when to escalate or notify users.

EasyTechnical
45 practiced

Compare WebSockets, Server-Sent Events (SSE), long polling, and regular polling for real-time client-server communication. For each transport explain: connection model (half/full-duplex), typical latency characteristics, browser/proxy support, server resource implications, and common use-cases (e.g., collaborative editing, live notifications, stock tickers). Conclude with recommended transport(s) for (a) a live chat app and (b) a server-to-many broadcasting system.

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.

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 8 Real-Time and Streaming System Design interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.