Spot the Wrong Claim About HTTP Status Code Classes
System DesignModel answerLast updated
Pick the one false statement among four claims about HTTP status code families, then explain the client-versus-server split and why it matters for retries, alerting, and API design.
HTTP Status Codes: Find the False Statement
Four statements about HTTP response status codes are listed below. Exactly one of them is wrong.
- A. A
100response tells the client it may go ahead and send the rest of its request. - B. Any
2xxresponse means the server received the request, understood it, and accepted it. - C. A
301response means the target resource now lives permanently at a different URL, so the client is being redirected. - D. Any
4xxresponse means the server itself ran into a fault or an abnormal condition while handling the request.
Your task:
- Identify which statement is incorrect.
- State what the incorrect statement should say instead.
- Briefly explain why the distinction matters to engineers building or operating web services (for example, in retry logic, monitoring, or API design).
Hints
Hint 1
Status codes are grouped by their first digit, and each group answers a single question: did it work, does the client need to do more, or who is at fault?
Hint 2
Check each option against its class: 1xx is interim, 2xx is success, 3xx is redirection. Then ask which party is blamed in 4xx and which in 5xx.
Hint 3
One option describes a fault on the server's side but attaches it to the wrong range of codes. Think about which range is meant for faults in the server.
Model answer
Easy Try it yourself first — then compare your approach, complexity and edge cases.
Answer: D
Option D is the false statement. Codes in the 4xx range are client errors: the server understood enough of the request to conclude that the request itself is the problem. Failures that originate on the server, even though the request was valid, are reported with 5xx codes. So D describes 5xx, not 4xx.
Approach
HTTP status codes (defined in RFC 9110) are grouped by their first digit. The quickest way to answer is to recall what each family means and compare each option with it.
| Class | Meaning | Examples |
|---|---|---|
1xx | Informational: the request was received, processing continues | 100 Continue, 101 Switching Protocols |
2xx | Success: the request was received, understood, and accepted | 200 OK, 201 Created, 204 No Content |
3xx | Redirection: the client needs to take another step | 301, 302, 304, 307, 308 |
4xx | Client error: the request is flawed or not permitted | 400, 401, 403, 404, 429 |
5xx | Server error: a valid request could not be fulfilled | 500, 502, 503, 504 |
A handy mnemonic: 4xx means the caller needs to change something; 5xx means the provider needs to fix something.
Checking each option
- A (true).
100 Continueis an interim response. A client can send request headers withExpect: 100-continueand hold back a large body until the server replies. This avoids uploading a big payload that would be rejected anyway, for instance because of missing credentials or an oversized body. - B (true). This is the standard description of the success class. Specific codes refine it:
201signals a resource was created,204signals success with no body. - C (true).
301 Moved Permanentlycarries the new address in theLocationheader. Because the move is permanent, clients, caches, and search engines are expected to update their stored URL. Temporary moves use302or307. - D (false). It assigns the server-fault meaning to the client-error range.
Why the client/server split matters
- Retry behavior. Many
5xxfailures are transient (502,503,504), so retrying with exponential backoff and jitter is sensible. Retrying an unchanged400or404is wasted effort because it will fail the same way. The notable exception is429 Too Many Requests: it is a4xx, but it is retryable once the delay inRetry-Afterhas elapsed. - Monitoring and alerting. A rise in
5xxgenerally means your service is unhealthy and should page someone. A rise in4xxoften points to a faulty client release, an expired credential, broken links, or scanner traffic. It deserves attention, but it is a different kind of incident. Many teams count only5xxagainst availability objectives. - API design. Returning
500for bad input is a frequent mistake. It hides client bugs, inflates server error rates, and encourages pointless retries. Use400or422for validation failures,401for missing or invalid credentials,403for insufficient permission, and404or409where appropriate.
Common traps
401vs403.401 Unauthorizedreally means unauthenticated: valid credentials were not provided.403 Forbiddenmeans the caller is identified but not allowed.304 Not Modifiedsits in the3xxfamily but does not redirect anywhere. It tells the client its cached copy is still current.301/302vs308/307. Older clients may switchPOSTtoGETwhen following301or302.307and308require the method and body to be preserved.- Gateway errors.
502and504are produced by a proxy when an upstream server fails or times out. From the caller's view they are still server-side failures. 1xxis never final. A final response always follows an informational one.
Optional code illustration
Classification needs only an integer division, so it runs in O(1) time and space.
def status_class(code: int) -> str:
families = {
1: "informational",
2: "success",
3: "redirection",
4: "client_error",
5: "server_error",
}
if not 100 <= code <= 599:
raise ValueError("not a standard status code range")
return families[code // 100]
def should_retry(code: int) -> bool:
# Transient server-side failures and rate limiting are worth retrying
# (with backoff, and honoring Retry-After for 429).
return code in (429, 502, 503, 504)
claims = {
"A": (100, "informational"),
"B": (200, "success"),
"C": (301, "redirection"),
"D": (404, "server_error"), # the claim made by option D
}
wrong = [k for k, (code, cls) in claims.items() if status_class(code) != cls]
print(wrong) # ['D']
Summary of a strong answer
State D immediately, correct it ("4xx means the client made a faulty request; 5xx means the server failed on a valid one"), and tie it to practical consequences: which failures to retry, which to alert on, and which code to return from your own APIs. Mentioning 429 as a retryable 4xx and the 401/403 difference shows applied understanding rather than rote memorization.