LearnThatStack Ace your next interview
Networking for Developers · question
Question 5 of 51

What do the 2xx, 3xx, 4xx, and 5xx status code families mean?

beginner
← All Networking for Developers questions
Re-explain

The first digit of a status code names its family, which says whether the request worked and who is at fault. You can react to the family before reading the exact code.

  • 2xx is success, like 200 OK or 201 Created.
  • 3xx is a redirect, used when the resource moved or has not changed.
  • 4xx is a client error, like 404 Not Found or 401 Unauthorized.
  • 5xx is a server error on a valid request.

The family guides retries and blame. Resending a 4xx rarely helps, but a retry after a 5xx often works, since the fault sits on the server.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

The diagram below the answer is the concept . Jump to it ↓

Tailored explanation · switch back to · ·
What should the new diagram focus on?
Guided practice for Networking for Developers One question at a time. Answer out loud, get graded, see what you missed.
How well did you know this?
AI:

Saved in this browser - sign in to keep your review list.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Interview lens How interviewers actually use this question

Likely follow-ups

  • What's the difference between 401 and 403, and how should a client react to each? 401 means missing or invalid credentials, so authenticate and try again. 403 means the server refuses this caller, and the same credentials won't help.
  • Are any 4xx codes worth retrying? How would the client do it? Name 429 Too Many Requests and 408 Request Timeout. Say the client waits, honors a Retry-After header if one is sent, and backs off.
  • A POST got a 504 from the gateway. Is it safe to retry, and how would you make it safe? The server may have applied the write before the gateway gave up. Retry only idempotent calls blindly, or send an idempotency key the server dedupes on.
  • When would you return a 301 versus a 302? 301 is permanent, so clients and search engines may cache it and update links. 302 is temporary, and clients keep using the original URL.
  • Your API returns 200 with an error message in the body. What breaks? Clients, caches, monitoring and retry logic read the status code first, so failures can get cached, missed by alerts and never retried.

What you can say

  1. The first digit of a status code names its family, and the family tells you whether the request worked and, if it failed, whose fault it was.
  2. 2xx is success, like 200 OK or 201 Created, and 3xx is a redirect, used when the resource moved or hasn't changed.
  3. 4xx is a client error, like 404 Not Found or 401 Unauthorized, so the problem is in the request itself.
  4. 5xx is a server error, which means the request was valid but the server failed to handle it.
  5. In practice, a client can react to the family before it even reads the exact code.
  6. That shapes retries too. Resending a 4xx unchanged rarely helps, but retrying after a 5xx often works because the fault was on the server.

Weak answers to avoid

  • Recites codes without the family rule Listing 200, 404 and 500 shows recall, not understanding. Lead with the rule that the first digit names the outcome and who is at fault, then give examples.
  • Retries every error the same way Resending a 400 or 404 unchanged just repeats the failure and adds load. Say a 4xx needs a fixed request, while a 5xx is often worth a retry with backoff.
  • Blames every 5xx on the app code A 502 or 504 often comes from a proxy or gateway when an upstream fails or is slow, and a 503 can mean overload. Say the server side failed, then find which hop.
Interview lens

Likely follow-ups, what you can say, and the weak answers to avoid.

Sign in free to open it Free account - the lens opens as soon as you're back.

Want a quick review of the fundamentals? See the Networking for Developers cheatsheet.

← Back to all Networking for Developers questions
Pro · $10/mo

44 of 51 Networking for Developers answers are in Pro.

Full answers, code samples, and AI explanations that go simpler or deeper. Cancel anytime.

  • Full answers + code
  • AI explanations, simpler or deeper
  • 1,000 AI credits / month
  • Cancel anytime