← Create New Paste

System Design Interview: A Video Conferencing Service Like Zoom

5 views
"Design a video conferencing system" tests real-time media, network constraints, and large-scale signaling. It differs from video streaming because latency must stay low enough for conversation. Here is a structured approach. 1. Requirements Functional: users create or join meetings with a link, share audio, video, and screen, chat, and see participants. Meetings range from two people to a few hundred, with optional recording. Non-functional: end-to-end latency ideally under about 150 to 300 ms; graceful quality degradation on poor networks; global availability; secure meetings (authentication, waiting rooms, encryption). 2. Signaling versus media Separate the two planes: - Signaling: joining a meeting, exchanging capabilities, participant lists, mute status, and chat. This uses WebSockets to a signaling service, with meeting state in a fast store like Redis. - Media: the actual audio and video packets, sent over UDP using WebRTC-style protocols (RTP/SRTP), because retransmitting late packets is useless for live conversation. 3. Media topology choices - Peer-to-peer mesh: each participant sends to everyone. Fine for two or three people; upload bandwidth explodes beyond that. - MCU (Multipoint Control Unit): a server decodes all streams, mixes them into one, and sends a single stream to each user. Low client bandwidth, but very CPU-heavy on servers and adds latency. - SFU (Selective Forwarding Unit): each client sends its stream once to a server, which forwards streams to other participants without decoding. This is the most common choice today. Choose the SFU and explain why: lower server cost than an MCU, and much better scaling than mesh. 4. Handling varied bandwidth Use simulcast: each sender uploads two or three resolutions of its video. The SFU forwards the high-resolution stream for the active speaker and low-resolution ones for thumbnails, and adapts per receiver based on network feedback. Audio gets priority over video when bandwidth is scarce. 5. NAT traversal Many users sit behind firewalls. Use STUN servers to discover public addresses and TURN servers to relay media when direct UDP fails. Mention that TURN relays are expensive, so you place them regionally. 6. Global deployment Route participants to the nearest media server region. For meetings spanning continents, connect regional SFUs to each other so each user's stream crosses the long-distance link only once. 7. Large meetings and webinars For hundreds of participants, forward only the video of the active speakers and a small grid; for webinars with thousands of viewers, convert to a low-latency streaming format for the audience. 8. Recording and extras A recording bot joins the meeting as a participant, composes streams, and uploads files to object storage. Chat and transcripts are stored separately. 9. Trade-offs to discuss End-to-end encryption versus server-side features like recording and transcription, cost of TURN relays, and SFU placement. Staying organized in the round Real-time systems have many moving parts. Linkjob AI (https://linkjob.ai) gives real-time help during live job interviews and technical interviews, reminding you of areas such as NAT traversal or failure handling while you lead your own design.
Created Nov 17, 2026 17:58 Expires Nov 17, 2027 17:58