Node.jsInterview preparation
Foundation·Concept·2 min read

Which HTTP status codes should I know?

Practice this question

Definition:

An HTTP status code describes the outcome of an HTTP request using a standard numeric category. Clients use it to decide whether to use a result, correct a request, authenticate or retry. A response body can add application details, but should not contradict the status code.

Key points:

  • 200: success; 201: created; 204: success without a response body.

  • 400: bad request; 401: missing/invalid authentication; 403: not allowed; 404: not found.

  • 409: conflict; 429: too many requests; 500: server error; 503: unavailable.

  • Do not return 200 for every failure; clients, monitoring and retry logic then lose useful information.

Interview point:

  • Distinguish 401 from 403 and explain that 5xx retries still need limits and safe request semantics.
Adapted from 02_NODE_EXPRESS_HTTP.md · “Which HTTP status codes should I know?”. Code examples are study fragments. Difficulty and core labels are editorial estimates; version-specific behavior should be checked against your project.