Q: What's the difference between TCP and UDP? "TCP is connection-oriented and reliable — three-way handshake to establish, ordered delivery, retransmission on loss. UDP is connectionless and best-effort — no handshake, no order guarantees, no retransmission. TCP for HTTP, SSH, most application traffic. UDP for DNS queries, VoIP, video streaming, anything where speed matters more than perfect delivery."
Q: Walk me through what happens when I type example.com into a browser. "DNS lookup first — browser checks its cache, OS cache, then queries the resolver, which walks the DNS hierarchy from root to TLD to authoritative server. With an IP, the browser opens a TCP connection on port 443. TLS handshake follows: server presents certificate, browser validates the chain, they negotiate keys. HTTP request goes over the encrypted connection. The request may hit a CDN edge, a load balancer, then the application server, possibly a database, then back. Response renders in the browser, which may make follow-up requests for assets."