HTTP interview questions — Easy
210 easy-level HTTP questions from our API Testing bank, each with the correct answer and an explanation of why it is correct.
What this covers
HTTP appears throughout API Testing interviews. At easy level, interviewers are typically checking that you know the fundamentals and can describe them precisely — definitions, defaults, and the basic mechanics. Work through these, then explain your answer out loud; the second part is what interviews actually test.
20 example questions
1. On a release readiness call: Which status family indicates a client error?
- A. 2xx.
- B. 3xx.
- C. 4xx.correct
- D. 5xx.
Why: 4xx are client errors; 5xx server errors, 2xx success, 3xx redirect.
2. Which of the following best describes 415 Unsupported Media Type in HTTP?
- A. Temporary redirect to another URI.
- B. Response identifier enabling conditional requests and caching.
- C. Server rejects the request body's content type.correct
- D. Upstream server returned an invalid response to a gateway.
Why: 415 Unsupported Media Type: Server rejects the request body's content type.
3. Which of the following best describes 405 Method Not Allowed in HTTP?
- A. Tells the server which media types the client can process.
- B. Upstream server returned an invalid response to a gateway.
- C. The HTTP method is not supported for this resource.correct
- D. Asks the server which methods/headers are permitted.
Why: 405 Method Not Allowed: The HTTP method is not supported for this resource.
4. In the context of HTTP, 502 Bad Gateway is best described as:
- A. Server rejects the request body's content type.
- B. Key-value data appended to the URL after ?
- C. Request conflicts with current resource state.
- D. Upstream server returned an invalid response to a gateway.correct
Why: 502 Bad Gateway: Upstream server returned an invalid response to a gateway.
5. In HTTP, what does 415 Unsupported Media Type do or refer to?
- A. Browser mechanism controlling cross-origin API access.
- B. Server rejects the request body's content type.correct
- C. Asks the server which methods/headers are permitted.
- D. Tells the server which media types the client can process.
Why: 415 Unsupported Media Type: Server rejects the request body's content type.
6. Which of the following best describes 502 Bad Gateway in HTTP?
- A. Cached response is still valid; no body returned.
- B. Response identifier enabling conditional requests and caching.
- C. Upstream server returned an invalid response to a gateway.correct
- D. Asks the server which methods/headers are permitted.
Why: 502 Bad Gateway: Upstream server returned an invalid response to a gateway.
7. Which of the following best describes OPTIONS method in HTTP?
- A. Key-value data appended to the URL after ?
- B. Tells the server which media types the client can process.
- C. Asks the server which methods/headers are permitted.correct
- D. Response identifier enabling conditional requests and caching.
Why: OPTIONS method: Asks the server which methods/headers are permitted.
8. Which of the following best describes path parameter in HTTP?
- A. Asks the server which methods/headers are permitted.
- B. Variable segment inside the URL path identifying a resource.correct
- C. Temporary redirect to another URI.
- D. Tells the server which media types the client can process.
Why: path parameter: Variable segment inside the URL path identifying a resource.
9. Which of the following best describes 304 Not Modified in HTTP?
- A. Cached response is still valid; no body returned.correct
- B. The HTTP method is not supported for this resource.
- C. Server rejects the request body's content type.
- D. Variable segment inside the URL path identifying a resource.
Why: 304 Not Modified: Cached response is still valid; no body returned.
10. In HTTP, what does 502 Bad Gateway do or refer to?
- A. Key-value data appended to the URL after ?
- B. Browser mechanism controlling cross-origin API access.
- C. Upstream server returned an invalid response to a gateway.correct
- D. Server rejects the request body's content type.
Why: 502 Bad Gateway: Upstream server returned an invalid response to a gateway.
11. In HTTP, what does OPTIONS method do or refer to?
- A. Key-value data appended to the URL after ?
- B. Asks the server which methods/headers are permitted.correct
- C. Browser mechanism controlling cross-origin API access.
- D. Temporary redirect to another URI.
Why: OPTIONS method: Asks the server which methods/headers are permitted.
12. While onboarding a junior QA, you explain: Which method is idempotent and used to replace a resource?
- A. POST.
- B. PATCH.
- C. PUT.correct
- D. CONNECT.
Why: PUT replaces a resource and is idempotent.
13. Which of the following best describes Accept header in HTTP?
- A. Cached response is still valid; no body returned.
- B. Tells the server which media types the client can process.correct
- C. Asks the server which methods/headers are permitted.
- D. Temporary redirect to another URI.
Why: Accept header: Tells the server which media types the client can process.
14. What is the purpose of 405 Method Not Allowed in HTTP?
- A. The HTTP method is not supported for this resource.correct
- B. Cached response is still valid; no body returned.
- C. Temporary redirect to another URI.
- D. Request conflicts with current resource state.
Why: 405 Method Not Allowed: The HTTP method is not supported for this resource.
15. In HTTP, what does 405 Method Not Allowed do or refer to?
- A. The HTTP method is not supported for this resource.correct
- B. Tells the server which media types the client can process.
- C. Temporary redirect to another URI.
- D. Upstream server returned an invalid response to a gateway.
Why: 405 Method Not Allowed: The HTTP method is not supported for this resource.
16. In HTTP, what does Accept header do or refer to?
- A. Key-value data appended to the URL after ?
- B. Server rejects the request body's content type.
- C. Tells the server which media types the client can process.correct
- D. Browser mechanism controlling cross-origin API access.
Why: Accept header: Tells the server which media types the client can process.
17. Which of the following best describes query parameter in HTTP?
- A. Browser mechanism controlling cross-origin API access.
- B. Tells the server which media types the client can process.
- C. Key-value data appended to the URL after ?correct
- D. Cached response is still valid; no body returned.
Why: query parameter: Key-value data appended to the URL after ?.
18. What is the purpose of 415 Unsupported Media Type in HTTP?
- A. Upstream server returned an invalid response to a gateway.
- B. Server rejects the request body's content type.correct
- C. Asks the server which methods/headers are permitted.
- D. Tells the server which media types the client can process.
Why: 415 Unsupported Media Type: Server rejects the request body's content type.
19. What is the purpose of path parameter in HTTP?
- A. Variable segment inside the URL path identifying a resource.correct
- B. The HTTP method is not supported for this resource.
- C. Asks the server which methods/headers are permitted.
- D. Browser mechanism controlling cross-origin API access.
Why: path parameter: Variable segment inside the URL path identifying a resource.
20. In HTTP, what does path parameter do or refer to?
- A. Response identifier enabling conditional requests and caching.
- B. Asks the server which methods/headers are permitted.
- C. Browser mechanism controlling cross-origin API access.
- D. Variable segment inside the URL path identifying a resource.correct
Why: path parameter: Variable segment inside the URL path identifying a resource.