Back to Browse

TCP vs UDP vs QUIC: System Design Interview Deep Dive | System Design Tutorial #3

101 views
Mar 3, 2026
41:49

In this System Design video, we break down the three pillars of data transmission: TCP, UDP, and the modern QUIC protocol. We start with the fundamentals of reliable communication using TCP (Transmission Control Protocol). You will learn how the "3-Way Handshake" establishes a secure connection using SYN and ACK packets and how sequence numbers ensure every byte reaches its destination intact—perfect for banking apps and file transfers. Next, we look at UDP (User Datagram Protocol), the "fire and forget" strategy. We cover why it skips the handshake to blast data for video streaming and online gaming, prioritizing speed over reliability. Finally, we dive into QUIC, the protocol that combines the speed of UDP with the reliability of TCP. We explain the critical difference between Kernel Space vs. User Space implementation and how QUIC solves the major issues of TCP (like Head-of-Line Blocking) using Connection IDs and Offset Frames. Index: 00:00 Introduction 00:50 What is TCP & How it work 09:03 What is UDP & How it work 12:31 What is QUIC & How it work (Important) 29:40 Comparison TCP, UDP and QUIC 35:18 Code TCP, UDP and QUIC 38:05 System Design Interview Questions System Design Interview Questions: Question: "You are building a real-time AI voice assistant that needs to work over mobile networks (4G/5G). A user is walking and their phone switches from their Home Wi-Fi to a Cell Tower. In TCP, the call would drop. Why does QUIC allow the call to continue without a new handshake?“ The Answer: TCP identifies a connection by the IP address. If the IP changes (Wi-Fi to LTE), the connection dies. QUIC uses a unique Connection ID that stays the same even if the IP changes, allowing the "stream" to continue. Question: "A user in India is accessing an AI server in the US with an RTT of 200ms. If you are using TCP + TLS 1.2, how much time passes before the user's first AI prompt actually reaches the server? How much time do you save by switching to QUIC?“ The Answer: * TCP + TLS 1.2: 3 RTTs = $600$ms of "wait time" before data flows.QUIC: 1 RTT = $200$ms of "wait time."Savings: You save 400ms, which is the difference between a "laggy" app and a "snappy" one. Question: "Your AI API sends a large 'System Message' (Stream A) and a short 'User Response' (Stream B) at the same time. If the packet containing the beginning of the 'System Message' is lost in transit, does the user have to wait to see the 'User Response' in HTTP/2 (over TCP)? What about HTTP/3 (over QUIC)?" The Answer: In HTTP/2 (TCP), yes. TCP is one single pipe; if any part is lost, the whole pipe stops. In HTTP/3 (QUIC), no. Because each stream has its own Offset sequence, Stream B can be delivered to the app even if Stream A is waiting for a re-transmission. In this video, you will learn: 🔹 TCP Reliability: Sequence Numbers, ISN, and the 3-Way Handshake. 🔹 UDP Speed: Why it creates no connection records and offers no retries. 🔹 QUIC Architecture: How it uses UDP for speed but adds a reliability layer in User Space. 🔹 Packet Recovery: How QUIC uses "Offset Frames" to reassemble data even if packets arrive out of order. 🔹 The "Three File" Problem: How QUIC downloads multiple files simultaneously without waiting for lost packets (solving Head-of-Line Blocking). 🔗 Course Navigation: Make sure to watch the full playlist to build your architecture knowledge step-by-step: https://www.youtube.com/playlist?list=PL0BwLgm6AcFZIk4FveSxXBL_YauDKv5Ga 👇 Join the Discussion! Did you know your OS caches DNS records before this video? Let me know in the comments! 📌 Subscribe for regular, high-quality tech tutorials! https://www.youtube.com/@CodeGoat-s2y?sub_confirmation=1 #SystemDesign #Networking #QUIC #TCP #UDP #SoftwareEngineering #BackendDevelopment

Download

0 formats

No download links available.

TCP vs UDP vs QUIC: System Design Interview Deep Dive | System Design Tutorial #3 | NatokHD