Skip to content
RED SAGSkills
easyBackend Developer interview question

Explain the HTTP status code classes and give examples of codes a REST API commonly returns.

What the interviewer wants to hear

  • 2xx success: 200, 201, 204
  • 3xx redirection and caching: 301, 304
  • 4xx client errors: 400, 401, 403, 404, 409, 422, 429
  • 5xx server errors: 500, 502, 503, 504
  • Correct codes help clients decide whether to retry

Model answer

Status codes are grouped by their first digit. 2xx means success: 200 OK for a normal response, 201 Created after creating a resource, and 204 No Content when there is nothing to return, such as after a delete. 3xx is about redirects and caching, like 301 for a permanent move and 304 Not Modified for a valid cached copy. 4xx means the client did something wrong: 400 for bad input, 401 when not authenticated, 403 when authenticated but not allowed, 404 when the resource does not exist, 409 for a conflict like a duplicate, 422 for valid JSON that fails business rules, and 429 for rate limiting. 5xx means the server failed: 500 for an unexpected error, 502 and 504 from gateways, and 503 when temporarily unavailable. Using them correctly matters because clients and proxies decide on retries from them: retrying a 503 makes sense, retrying a 400 does not.

Can you answer it under time pressure?

Take a timed easy round and get scored on every answer.

Start mock interview

More easy Backend Developer questions