Zoom uses UDP for live video streams because losing an occasional frame is acceptable compared to buffering delay. REST APIs use TCP because dropping a single JSON byte corrupts the response payload.
Client sends SYN packet with initial sequence number ISN(c).
Server responds with SYN-ACK, acknowledging ISN(c)+1 and providing server ISN(s).
Client acknowledges ISN(s)+1; connection established for data transmission.
4-step teardown (FIN, ACK, FIN, ACK) safely closes connection.
| Feature / Dimension | TCP | UDP |
|---|---|---|
| Connection Type | Connection-oriented (Requires 3-Way Handshake) | Connectionless (Fire and forget) |
| Reliability | Guaranteed delivery via retransmissions | No guarantee; lost packets dropped |
| Packet Order | In-order byte stream (uses Sequence Numbers) | No ordering guarantees |
| Speed & Latency | Slower due to handshakes and ACKs | Extremely fast with minimal header (8 bytes) |
Detailed answers, interviewer pro tips, key takeaway summaries, and code examples formulated for technical rounds.
✅ Correction: DNS queries and modern HTTP/3 (QUIC) run entirely on top of UDP!
Transport layer protocols for reliable stream vs speed-optimized datagrams.
Client initiates connection by sending a SYN packet with a random initial sequence number (ISN = 100).
Server acknowledges client SYN by returning ACK = 101 and sends its own server sequence number (ISN = 300).
Client acknowledges server SYN with ACK = 301. Connection is now ESTABLISHED for data stream transfer!