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

How would you implement authentication and authorization for long-lived WebSocket connections in a multi-tenant SaaS product? Cover initial token exchange during the handshake, token refresh for long-lived sessions, per-message authorization checks where needed, handling token revocation or tenant deprovisioning (including third-party API consumers, not just browser clients), and techniques to minimize re-auth overhead while ensuring security.

MediumTechnical
55 practiced

Compare WebRTC data channels and WebSocket for real-time peer-to-peer data synchronization use cases (e.g., multi-user collaborative whiteboard). Include signaling architecture, NAT traversal (STUN/TURN), expected throughput/latency differences, privacy/security trade-offs, and operational costs/complexity (TURN servers, scaling signaling). When would you choose one over the other?

MediumTechnical
51 practiced

Estimate and compare the per-connection server resource implications (file descriptors, memory per connection, CPU context switching or event-loop overhead) and request pattern characteristics for: (a) persistent WebSocket connections, (b) Server-Sent Events (SSE), and (c) short polling every 5 seconds. Provide a back-of-envelope calculation for 1M concurrent clients and discuss the main bottlenecks and mitigation strategies.

HardSystem Design
48 practiced

Design an end-to-end realtime system to broadcast order-book updates for a high-frequency trading platform to thousands of subscribers. Requirements: maintain strict ordering per instrument, sub-10ms tail latency within region, support replay of missed updates for up to 1 minute, guarantee at-most-once delivery for downstream processing, and handle 100k updates/sec. Detail components (ingest, sequencer, transport), storage for replay, sequencing, backpressure handling, and operational considerations.

HardTechnical
60 practiced

Design strategies to manage memory usage for per-connection state in servers handling millions of persistent connections, so growth in connection count does not cause unpredictable memory spikes, OOM kills, or long GC pauses. Explain how you would represent, store, and evict that state, and how you would validate your approach holds at scale.

Unlock Full Question Bank

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

Sign in to Continue

Join thousands of developers preparing for their dream job.