Skip to main content
|1 / 54
Fundamentals

Client-Server Model

Clients request, servers respond. The foundation of the web.

HTTP is request-response: client always initiates. Server cannot push without WebSocket/SSE
DNS resolution chain: browser → recursive resolver → root NS → TLD NS → authoritative NS → IP
HTTP methods: GET (safe, idempotent), POST (create), PUT (replace), PATCH (partial), DELETE (idempotent)
Status codes: 2xx success, 3xx redirect, 4xx client error (auth, not found), 5xx server error
Stateless protocol: each request carries all context. Cookies/headers add state on top
TCP 3-way handshake (SYN → SYN-ACK → ACK) before HTTP data flows. TLS adds 1–2 more round trips
HTTP/1.1: keep-alive persistent connections. HTTP/2: multiplexing (multiple streams, 1 TCP). HTTP/3: QUIC over UDP, eliminates head-of-line blocking
When to use: Open every design by walking the request path: DNS → CDN/LB → app server → cache → DB. Interviewers score this narration before any boxes are drawn.