Computer Networking Interview

Every question shows beginner, strong and expert answers, green and red flags, follow-ups and a scenario. Memorised one-liners are not rewarded: the strong answer names the mechanism, the trade-off and the failure implication.

FundamentalsIntermediate
What happens when you type a URL
What happens when you type a URL into your browser and press Enter? Take it as deep as you can.
FundamentalsBeginner
OSI vs TCP/IP
What is the difference between the OSI model and the TCP/IP model, and does the difference matter in practice?
FundamentalsBeginner
Encapsulation
Describe what happens to an HTTP request as it goes down the stack on the sender and up on the receiver. What does each layer add and why?
IP & routingBeginner
Switch vs router
What is the difference between a switch and a router? What does each one look at, and what does each one change in the packet?
IP & routingBeginner
Subnets and CIDR
What does `10.4.16.0/20` mean? How does a host decide whether a destination is on its own subnet, and what happens differently if it is not?
IP & routingIntermediate
NAT
How does NAT let a hundred devices share one public IP? What does the NAT device keep, and what breaks because of it?
IP & routingIntermediate
Longest-prefix match
A router has routes for `10.0.0.0/8`, `10.4.0.0/16` and `0.0.0.0/0`. A packet arrives for `10.4.7.9`. Which route wins, and why is that the rule?
IP & routingIntermediate
Why IPv6
Why does IPv6 exist, and what changes besides the address length? What can go wrong in a dual-stack deployment?
DNSBeginner
DNS resolution
Walk through how `api.example.com` becomes an IP address, from the application call to the authoritative server. Who is involved and who caches what?
DNSIntermediate
DNS TTL and migrations
You need to move a service to a new IP with no downtime. How do DNS TTLs affect the plan, and what goes wrong if you ignore them?
TransportBeginner
TCP vs UDP
Compare TCP and UDP. When would you choose UDP, and what do you have to build yourself when you do?
TransportIntermediate
The three-way handshake
Explain the TCP three-way handshake. Why three packets, what state exists on each side, and what can go wrong before a byte of data is sent?
TransportIntermediate
Flow control vs congestion control
What is the difference between flow control and congestion control in TCP? Who is each one protecting, and how does the sender know the limit?
TransportIntermediate
Head-of-line blocking
What is head-of-line blocking? Where does it occur in TCP, in HTTP/1.1 and in HTTP/2, and what does HTTP/3 actually change about it?
TransportAdvanced
TIME_WAIT
Why does a TCP connection sit in TIME_WAIT after it closes? Which side ends up in that state, and when does it become a production problem?
TLSIntermediate
The TLS handshake
Walk me through a TLS handshake. What does each side learn, how many round trips does it cost, and what changed between TLS 1.2 and TLS 1.3?
TLSIntermediate
How a certificate is verified
When your browser connects to a site over HTTPS, how does it decide that the server’s certificate is trustworthy? What can make that check fail even though the certificate is genuine?
HTTPAdvanced
HTTP/2 vs HTTP/3
What did HTTP/2 fix over HTTP/1.1, what problem did it leave behind, and how does HTTP/3 address it? When would you choose not to deploy HTTP/3?
HTTPIntermediate
Keep-alive and connection reuse
What does HTTP keep-alive do, what does it cost, and what goes wrong when a client and a server disagree about how long a connection stays open?
HTTPIntermediate
WebSockets vs Server-Sent Events
You need to push updates from a server to a browser. Compare long polling, Server-Sent Events and WebSockets: what does each cost at the network layer, what breaks with each in production, and how do you choose?
InfrastructureIntermediate
L4 vs L7 load balancing
What is the difference between a layer-4 and a layer-7 load balancer? What does each one see, what can each one do, and what does each one break?
InfrastructureIntermediate
How a CDN works
How does a CDN make a site faster at the network level? How does a client end up at a nearby edge, and what can a CDN do for content that cannot be cached?
ProductionIntermediate
Ping fails, service works
`ping api.example.com` times out, but `curl https://api.example.com/` returns 200 from the same machine. Explain how both can be true, and what `ping` actually proves in each direction.
ProductionIntermediate
502 vs 503 vs 504
Your service sits behind a load balancer. Users report 502, 503 and 504 errors. What does each one mean, who generated it, and where do you look first for each?
ProductionAdvanced
Slow requests, idle server
Requests to your API take 3 seconds at p99, but the server sits at 5% CPU and the handler itself measures 20 ms. Where can the other 2.98 seconds be, and how would you find them?
OS + NetworkingIntermediate
Walk me from send() on one machine to recv() on another
Process A calls `send(sock, buf, 1024)` and process B, on another host, is blocked in `recv()`. Describe every step, every copy, and every place the bytes can wait.
OS + NetworkingAdvanced
How does one server handle 10,000 (or 100,000) concurrent connections?
Explain what limits a server’s concurrent connections and how a modern server reaches 100K. Be specific about what each connection costs in the kernel and in the process.
OS + NetworkingIntermediate
Blocking servers vs event-driven servers
Compare a thread-per-connection server with an event-driven one. What is actually blocking, in the kernel, when a thread "blocks"? When is each design the right one?
OS + NetworkingAdvanced
What is backpressure, physically?
A producer sends faster than a consumer can handle. Explain, layer by layer, what happens in the kernel and on the network — and why a slow consumer can freeze a fast producer.
OS + NetworkingAdvanced
What does "zero-copy" actually eliminate?
Serving a static file over a socket: count the copies and mode switches in the naive `read()` + `send()` loop, then explain what `sendfile()`, `mmap()` and `splice()` change and when they matter.
OS + NetworkingExpert
A user in Warsaw waits 3 seconds. Where did the time go?
A user in Warsaw loads a page from your service hosted in Virginia and it takes 3 seconds; your server metrics show 30 ms of handler time. Walk through every layer where those 3 seconds could be, name the domain that explains each, and say how you would measure it.