Text preview & study summary
Common HTTP Status Codes
A free sample of 5 questions from this quiz, shown in full with answer choices and explanations. No interactivity — everything is visible on this page for study and review.
Want to test your knowledge? Launch the Interactive Exam Simulator
Question 1
When an HTTP 301 redirect is returned, modern browsers will permanently remember the redirect and skip the original URL entirely on future requests.
Explanation
Browsers cache 301 redirects (sometimes indefinitely, depending on cache-control headers). Once a browser has seen a 301, it may skip requesting the old URL and go directly to the new URL on subsequent visits without asking the server. This can cause issues during development — you may need to clear browser cache to "forget" a 301 redirect. This is why 302 (temporary) is used when the redirect is not permanent.
Question 2
What is the difference between HTTP 301 and 302 redirects?
Explanation
HTTP 301 Moved Permanently signals a permanent redirect — browsers cache the new URL and search engines transfer "link juice" to the new URL. HTTP 302 Found (or Moved Temporarily) signals a temporary redirect — browsers do not permanently cache it and search engines keep the original URL indexed. Use 301 for permanent moves; use 302 for temporary situations (maintenance, A/B testing).
Question 3
What does HTTP 503 Service Unavailable indicate, and how does it differ from 500?
Explanation
HTTP 500 Internal Server Error is a generic "something went wrong on the server" error — often a bug in the application code (unhandled exception, database error). HTTP 503 Service Unavailable specifically means the server is temporarily unable to handle requests, usually due to overload or scheduled maintenance. 503 often includes a `Retry-After` header. From a user/operations perspective: 500 often requires code fixes; 503 may resolve itself or after maintenance.
Question 4
HTTP 403 Forbidden and HTTP 401 Unauthorized both indicate that the client is not authenticated.
Explanation
They differ: 401 Unauthorized means the client is NOT authenticated (no credentials provided or credentials are invalid) — the client should log in. 403 Forbidden means the client IS authenticated but does NOT have permission to access the resource — even valid credentials won't help unless you have the right permissions. Example: a logged-in regular user trying to access an admin page gets 403, not 401.
Question 5
When a REST API receives a POST request and successfully creates a new resource, it should return HTTP status code [[blank1]], and when a DELETE request is processed successfully with nothing to return, it should return [[blank2]].
Explanation
RESTful API best practices: POST that creates a resource → 201 Created (often with the created resource in the body or its URL in the Location header). DELETE that succeeds → 204 No Content (confirms deletion, nothing to return). Using the precise status code improves API clarity and helps clients handle responses correctly. Many APIs incorrectly return 200 for all successful operations, missing the semantic value of specific codes.
