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
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.

MediumSystem Design
90 practiced

Design a comments feature for collaborative document editing (comment threads anchored to document ranges). Clarify requirements with product (real-time vs. non-real-time, access control, edit history), state your assumptions, propose two different approaches for keeping a comment thread in sync in real time plus one for offline-first comments, discuss the trade-offs in consistency, latency, and usability, and outline how you'd communicate the design to product and QA.

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
50 practiced

Describe a robust client-side feature detection and fallback strategy for environments where WebSocket is blocked or unreliable. Include how to detect failures/blocks (e.g., blocked Upgrade header, connection resets), how to choose between SSE and long-polling fallback, how to preserve session semantics and message ordering across fallback transitions, and how to keep server-side behavior consistent.

EasyTechnical
95 practiced

Implement a simple per-connection fixed-size ring buffer in Python to hold the last N messages for replay after reconnection. Provide methods: append(message), get_since(sequence_id) which returns messages after a given sequence number, and trim to enforce capacity. Consider memory efficiency and how to represent sequence numbers.

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.