Networking Essentials
Beginner · 18 min read · High-Level Design, Foundations
DNS, TCP vs UDP, HTTP versions and TLS — what actually happens between client and server.
Every distributed system is, at its core, programs exchanging messages over a network. You don't need to be a network engineer for a design interview, but you do need to know what happens between a client and a server well enough to reason about latency, reliability, and the protocol choices that follow from them.
The layers that matter
The OSI model has seven layers; in practice you need four mental buckets:
What happens when you type a URL
This classic question is a good tour of everything in this lesson.
DNS
The Domain Name System is a globally distributed, hierarchical, heavily cached key-value store mapping names to records.
TCP vs UDP
The cost: a handshake before data can flow, and head-of-line blocking — if one segment is lost, everything after it waits for the retransmission, even if it has already arrived.
HTTP and its versions
HTTP is a request/response protocol: a client sends a method (GET, POST, PUT, PATCH, DELETE), a path, headers, and an optional body; the server replies with a status code, headers and a body.
TLS in one paragraph
TLS provides encryption (no eavesdropping), integrity (no tampering), and authentication (you're talking to the real server, verified via a certificate chain signed by a trusted Certificate Authority).
Putting it together: latency budget
Consider a user in Mumbai calling an API hosted in Virginia (RTT ≈ 220 ms):
Interview questions
- Why would you choose UDP over TCP? Give a concrete example.
- What problem does HTTP/2 solve and what problem does it leave unsolved?
- How does DNS-based failover work and what are its limitations?
- What's the difference between an L4 and an L7 load balancer, in networking terms?
Practice
Write your answer before opening the suggested one. If you mark it "Partly" or "Missed it", it comes back in your review deck.
Further reading
Key takeaways
- A new HTTPS connection costs ~3 round trips before data flows; reducing round trips on long paths is the main lever for latency.
- DNS is a cached, distributed lookup; TTLs make DNS-based failover slow.
- TCP gives reliable ordered delivery at the cost of handshakes and head-of-line blocking; UDP trades reliability for timeliness.
- HTTP/2 multiplexes over one TCP connection; HTTP/3 moves to QUIC to remove transport-level head-of-line blocking.
- Reuse connections — via keep-alive and connection pools — and watch connection counts on databases.
Previous: Back-of-the-Envelope Estimation · Next: Scalability: Vertical vs Horizontal