Interview Prep/Networking/TLS, HTTP & Application Layer

What is the difference between 4xx and 5xx errors, and which ones do you see most in networking problems?

BeginnerScenarioTLS, HTTP & Application Layer
Answer

Situation read → Client versus server errors, and which of them point at infrastructure.

What I'd do →

  1. 4xx means the request is the problem: 400 bad request, 401 and 403 auth, 404 not found, 429 rate limited
  2. 5xx means the server or path failed: 500 app error, 502 bad gateway (invalid response from upstream), 503 unavailable (no healthy targets or overload), 504 gateway timeout (upstream too slow)
  3. From the proxy log compare upstream_status and status
  4. Test the backend directly with curl -v http://10.0.1.10:8080/health

Why → 502, 503 and 504 almost always mean the proxy or load balancer cannot get a good answer from its backend.

Interview tip → Say you map 502 to bad response, 503 to no capacity and 504 to slow response.

All Networking questions Roadmap: Networking for DevOps

More on TLS, HTTP & Application Layer