Interview's MateSystem Design
Interview's Mate

System Design

Architecture & trade-offs

Visualizer

DSA Visualizer
All 32 lessons
Custom Playground
Try your own examples

Learning

System Design
31 architecture topics
SQL Learning
160 foundations → production topics
AI Engineering
160 LLM → backend topics
Data Science
160 Python → MLOps topics
Data Engineer
160 SQL → streaming topics
Docker
160 Docker learning topics
Kubernetes
160 K8s fundamentals → cloud
Java LearnSoon
Coming soon
Python Learn
Interview Q&A & internals
JavaScript Learn
Closures, async & DOM Q&A
Tech Learn
Search, practise & track Q&A
AI DSA Practice
Solve coding problems
Theme
Home
System Design topics
Lesson 7/ 31
Fundamentals & Networking

Networking & Protocols

Pick the right transport and wire protocol for latency, reliability, and streaming.

IntermediateTCP/UDP · HTTP/2 · QUIC · gRPC3 quiz questions0/2 subtopics done
Practice in AI HLD
In plain wordsDiagramTheorySubtopics (2)Step by stepWhen to use itInterview cluesMistakes to avoidQuiz (3)Practice
Deep-dive subtopics (2) - 0/2 completed
TCP vs. UDP

Understand reliable ordered streams (TCP) versus fast, connectionless datagrams (UDP).

Beginner
HTTP/2, HTTP/3 (QUIC) & gRPC

Multiplexing, mobile-friendly QUIC connections, and binary service-to-service RPC.

Intermediate

In plain words

Protocols are agreed rules for how computers talk. TCP makes sure every message arrives in order, UDP is faster but may drop messages, and HTTP is the language of the web on top of them.

Think of it like…

TCP is registered certified mail with receipts; UDP is throwing postcards over a fence - faster, with no guarantee they arrive in order.

Where you’ve seen it

Loading a web page uses HTTP over TCP, so nothing gets lost. A video call uses UDP, because a dropped frame is better than a frozen screen while waiting for a resend.

Words you’ll hear

TCP
Reliable, ordered delivery; retries anything that gets lost.
UDP
Fast, fire-and-forget delivery with no guarantees.
TLS
Encryption that turns HTTP into HTTPS.
Latency
How long a message takes to travel from one machine to another.

Visual diagram

Loading interactive diagram
Loading interactive exercise

Theory & deep dive

TCP vs. UDP: reliability vs. real-time speed

TCP guarantees every byte arrives in exact order. If packet #4 gets lost, TCP pauses delivering packets #5, #6, and #7 until #4 is retransmitted. That’s essential for loading a webpage, downloading a file, or running a bank transaction.

UDP sends packets without checking if every single one arrived. On a live Zoom call or online shooter game, waiting 200 ms to re-fetch a dropped frame from 0.2 seconds ago ruins the call - better to skip it and show the latest video frame now.

Key takeaway: Use TCP for correctness (web, APIs, DBs); use UDP for live media and gaming where fresh beats late.

HTTP/1.1 → HTTP/2 → HTTP/3 (QUIC) & gRPC

HTTP/1.1 processed one request per TCP connection at a time, forcing browsers to open 6 parallel connections. HTTP/2 multiplexes dozens of parallel streams over one TCP connection with compressed headers.

HTTP/3 (over QUIC/UDP) fixes TCP’s head-of-line blocking on lossy mobile Wi-Fi/5G and reconnects seamlessly when your phone switches from Wi-Fi to cellular. Meanwhile, gRPC uses HTTP/2 + compact binary Protobuf payloads for ultra-fast service-to-service communication.

How it works, step by step

Step 1 of 4
L4 Transport

1. Transport layer: TCP vs. UDP

TCP guarantees ordered, lossless delivery with congestion control (3-way handshake). UDP sends independent datagrams with zero connection state.

TCP = correctness · UDP = real-time media & QUIC
Key numbers at this step
TCP Handshake
1 RTT (+1–2 TLS)
UDP Overhead
8-byte header

When to use it & trade-offs

What it is

Protocols govern how bytes move between clients and services - from TCP/UDP at L4 to HTTP/2, HTTP/3 (QUIC), gRPC, and TLS at the session/application boundary.

Why it matters: Choosing TCP vs. UDP or HTTP/1.1 vs. HTTP/2/gRPC directly shapes head-of-line blocking, mobile reconnect speed, and video/gaming jitter.

When to reach for it

  • REST/JSON at the public API edge; gRPC between internal backend services
  • HTTP/3 (QUIC) for mobile-heavy apps switching between Wi-Fi and cellular
  • UDP/WebRTC for sub-200 ms audio/video calls where stale packets should be dropped

When to avoid or be careful

  • Opening a fresh TCP + TLS connection for every internal microservice call
  • Running real-time voice/video over TCP (retransmissions stall the entire stream)

Protocol Selection Matrix

REST over HTTP/2–3
Best for: Public web/mobile APIs, CDN-cacheable GETs

Strengths: Universal tooling, human-readable JSON, native HTTP caching.

Watch out: Larger text payloads and looser schema enforcement without OpenAPI.

gRPC (HTTP/2 + Protobuf)
Best for: Internal microservice-to-microservice RPCs

Strengths: Strict typed contracts, compact binary frames, streaming, deadlines.

Watch out: Requires gRPC-Web proxy for browsers; binary payloads harder to inspect casually.

UDP / WebRTC / QUIC
Best for: Live video calls, multiplayer gaming, lossy mobile clients

Strengths: No cross-stream TCP head-of-line blocking; fast connection migration.

Watch out: Must implement reliability/congestion logic (or rely on QUIC/WebRTC).

Interview signals & numbers to know

When this topic comes up

  • video call
  • low latency mobile
  • internal RPC
  • streaming
  • binary protocol

Benchmarks & rules of thumb

TCP + TLS 1.3 handshake -
2 RTT cold (1 RTT TFO)
Protobuf vs JSON size -
~3–10× smaller
MTU typical Ethernet -
1,500 bytes
Voice/video target latency -
<150 ms

Common mistakes & follow-ups

Common interview mistakes

  • Forgetting TCP head-of-line blocking still affects HTTP/2 when a single packet is lost
  • Using REST polling for high-frequency internal streams where gRPC streaming fits naturally
  • Not configuring RPC timeouts/deadlines on gRPC or HTTP clients

Likely interviewer follow-ups

  • Why did HTTP/3 move from TCP to UDP (QUIC)?
  • How does connection migration in QUIC help mobile users walking out of Wi-Fi range?
  • When would you keep REST instead of switching everything to gRPC?
Interview tip: Use REST/HTTP at the edge for compatibility and caching, and gRPC internally for speed and strict contracts.

Knowledge check

Loading quiz

Put it into practice

Design full architectures with AI feedback

Apply Networking & Protocols inside real High-Level Design prompts or review Q&A flashcards.

Open AI HLD Practice →SD Interview Q&A
Previous topic
Consistent Hashing
Next topic
Database Design (SQL vs. NoSQL)