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. Which of the following best describes 405 Method Not Allowed in HTTP?
- A. Key-value data appended to the URL after ?
- B. Server rejects the request body's content type.
- C. The HTTP method is not supported for this resource.correct
- D. Temporary redirect to another URI.
Why: 405 Method Not Allowed: The HTTP method is not supported for this resource.
2. In the context of HTTP, 405 Method Not Allowed is best described as:
- A. Asks the server which methods/headers are permitted.
- B. Key-value data appended to the URL after ?
- C. Tells the server which media types the client can process.
- D. The HTTP method is not supported for this resource.correct
Why: 405 Method Not Allowed: The HTTP method is not supported for this resource.
3. Which of the following best describes 415 Unsupported Media Type in HTTP?
- A. Server rejects the request body's content type.correct
- B. Response identifier enabling conditional requests and caching.
- C. Key-value data appended to the URL after ?
- D. Temporary redirect to another URI.
Why: 415 Unsupported Media Type: Server rejects the request body's content type.
4. In a CI/CD pipeline review, consider this: 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.
5. Which of the following best describes OPTIONS method in HTTP?
- A. Variable segment inside the URL path identifying a resource.
- B. Temporary redirect to another URI.
- 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.
6. Which of the following best describes path parameter in HTTP?
- A. Cached response is still valid; no body returned.
- B. Variable segment inside the URL path identifying a resource.correct
- C. Request conflicts with current resource state.
- D. Asks the server which methods/headers are permitted.
Why: path parameter: Variable segment inside the URL path identifying a resource.
7. In HTTP, what does 415 Unsupported Media Type do or refer to?
- A. Asks the server which methods/headers are permitted.
- B. Browser mechanism controlling cross-origin API access.
- C. Server rejects the request body's content type.correct
- D. Request conflicts with current resource state.
Why: 415 Unsupported Media Type: Server rejects the request body's content type.
8. Which of the following best describes 502 Bad Gateway in HTTP?
- A. Request conflicts with current resource state.
- B. Upstream server returned an invalid response to a gateway.correct
- C. Browser mechanism controlling cross-origin API access.
- D. Tells the server which media types the client can process.
Why: 502 Bad Gateway: Upstream server returned an invalid response to a gateway.
9. Which of the following best describes 304 Not Modified in HTTP?
- A. Cached response is still valid; no body returned.correct
- B. Response identifier enabling conditional requests and caching.
- C. Browser mechanism controlling cross-origin API access.
- D. Upstream server returned an invalid response to a gateway.
Why: 304 Not Modified: Cached response is still valid; no body returned.
10. Which HTTP status code family indicates a client-side error such as a bad request or unauthorized access?
- A. 2xx.
- B. 3xx.
- C. 4xx.correct
- D. 5xx.
Why: 4xx codes (400, 401, 403, 404, …) indicate client errors; 5xx indicate server errors, 2xx success, 3xx redirection.
11. 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.
12. What is the purpose of path parameter in HTTP?
- A. The HTTP method is not supported for this resource.
- B. Variable segment inside the URL path identifying a resource.correct
- C. Cached response is still valid; no body returned.
- D. Tells the server which media types the client can process.
Why: path parameter: Variable segment inside the URL path identifying a resource.
13. What is the purpose of Accept header in HTTP?
- A. Variable segment inside the URL path identifying a resource.
- B. The HTTP method is not supported for this resource.
- C. Tells the server which media types the client can process.correct
- D. Cached response is still valid; no body returned.
Why: Accept header: Tells the server which media types the client can process.
14. 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.
15. What is the purpose of ETag in HTTP?
- A. Variable segment inside the URL path identifying a resource.
- B. Key-value data appended to the URL after ?
- C. Asks the server which methods/headers are permitted.
- D. Response identifier enabling conditional requests and caching.correct
Why: ETag: Response identifier enabling conditional requests and caching.
16. During a sprint demo, a teammate asks: 201 Created is typically returned by which method?
- A. GET.
- B. DELETE.
- C. HEAD.
- D. POST creating a resource.correct
Why: A successful resource-creating POST commonly returns 201.
17. Which of the following best describes query parameter in HTTP?
- A. Key-value data appended to the URL after ?correct
- B. Temporary redirect to another URI.
- C. Cached response is still valid; no body returned.
- D. Browser mechanism controlling cross-origin API access.
Why: query parameter: Key-value data appended to the URL after ?.
18. What is the purpose of 405 Method Not Allowed in HTTP?
- A. Variable segment inside the URL path identifying a resource.
- B. Tells the server which media types the client can process.
- C. The HTTP method is not supported for this resource.correct
- D. Cached response is still valid; no body returned.
Why: 405 Method Not Allowed: The HTTP method is not supported for this resource.
19. In HTTP, what does Accept header do or refer to?
- A. Response identifier enabling conditional requests and caching.
- B. Tells the server which media types the client can process.correct
- C. Upstream server returned an invalid response to a gateway.
- D. The HTTP method is not supported for this resource.
Why: Accept header: Tells the server which media types the client can process.
20. In HTTP, what does OPTIONS method do or refer to?
- A. Response identifier enabling conditional requests and caching.
- B. Tells the server which media types the client can process.
- C. Asks the server which methods/headers are permitted.correct
- D. Request conflicts with current resource state.
Why: OPTIONS method: Asks the server which methods/headers are permitted.