Skip to content

HTTP interview questions — Medium

408 medium-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 medium level, interviewers are typically checking that you have used it in practice: what you configured, what broke, and how you knew it worked. Work through these, then explain your answer out loud; the second part is what interviews actually test.

20 example questions

  1. 1. "Server rejects the request body's content type" — in HTTP, this describes which of the following?

    • A. 415 Unsupported Media Type.correct
    • B. 502 Bad Gateway.
    • C. OPTIONS method.
    • D. 405 Method Not Allowed.

    Why: 415 Unsupported Media Type: Server rejects the request body's content type.

  2. 2. "Upstream server returned an invalid response to a gateway" — in HTTP, this describes which of the following?

    • A. 302 Found.
    • B. 304 Not Modified.
    • C. 502 Bad Gateway.correct
    • D. Query parameter.

    Why: 502 Bad Gateway: Upstream server returned an invalid response to a gateway.

  3. 3. "Tells the server which media types the client can process" — in HTTP, this describes which of the following?

    • A. 415 Unsupported Media Type.
    • B. CORS.
    • C. Accept header.correct
    • D. 409 Conflict.

    Why: Accept header: Tells the server which media types the client can process.

  4. 4. "Asks the server which methods/headers are permitted" — in HTTP, this describes which of the following?

    • A. ETag.
    • B. OPTIONS method.correct
    • C. Path parameter.
    • D. CORS.

    Why: OPTIONS method: Asks the server which methods/headers are permitted.

  5. 5. "Variable segment inside the URL path identifying a resource" — in HTTP, this describes which of the following?

    • A. Path parameter.correct
    • B. 502 Bad Gateway.
    • C. 415 Unsupported Media Type.
    • D. 304 Not Modified.

    Why: path parameter: Variable segment inside the URL path identifying a resource.

  6. 6. In a QA certification mock exam: Which status family indicates a client error?

    • A. 2xx.
    • B. 3xx.
    • C. 5xx.
    • D. 4xx.correct

    Why: 4xx are client errors; 5xx server errors, 2xx success, 3xx redirect.

  7. 7. "Cached response is still valid; no body returned" — in HTTP, this describes which of the following?

    • A. 304 Not Modified.correct
    • B. 502 Bad Gateway.
    • C. 302 Found.
    • D. 415 Unsupported Media Type.

    Why: 304 Not Modified: Cached response is still valid; no body returned.

  8. 8. "The HTTP method is not supported for this resource" — in HTTP, this describes which of the following?

    • A. ETag.
    • B. Query parameter.
    • C. 405 Method Not Allowed.correct
    • D. 302 Found.

    Why: 405 Method Not Allowed: The HTTP method is not supported for this resource.

  9. 9. "Temporary redirect to another URI" — in HTTP, this describes which of the following?

    • A. 302 Found.correct
    • B. 405 Method Not Allowed.
    • C. 409 Conflict.
    • D. Query parameter.

    Why: 302 Found: Temporary redirect to another URI.

  10. 10. Which of the following statements about HTTP is TRUE?

    • A. POST is not idempotent: repeating it may create multiple resources.correct
    • B. The Content-Type header specifies the client's preferred language.
    • C. PATCH always replaces the entire resource representation.
    • D. POST is guaranteed idempotent by the HTTP specification.

    Why: Duplicate POSTs can create duplicates unless idempotency keys are used.

  11. 11. In a QA certification mock exam: 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.

  12. 12. "Key-value data appended to the URL after ?" — in HTTP, this describes which of the following?

    • A. 409 Conflict.
    • B. 502 Bad Gateway.
    • C. 302 Found.
    • D. Query parameter.correct

    Why: query parameter: Key-value data appended to the URL after ?.

  13. 13. Identify the accurate statement about HTTP:

    • A. Status 401 means the user is authenticated but lacks permission.
    • B. Status 401 Unauthorized means authentication is missing or invalid.correct
    • C. The Content-Type header specifies the client's preferred language.
    • D. HTTPS is identical to HTTP with no encryption involved.

    Why: 401 asks the client to authenticate; despite the name it is about authentication.

  14. 14. "Request conflicts with current resource state" — in HTTP, this describes which of the following?

    • A. 409 Conflict.correct
    • B. Accept header.
    • C. 415 Unsupported Media Type.
    • D. 405 Method Not Allowed.

    Why: 409 Conflict: Request conflicts with current resource state.

  15. 15. "Browser mechanism controlling cross-origin API access" — in HTTP, this describes which of the following?

    • A. ETag.
    • B. Path parameter.
    • C. 302 Found.
    • D. CORS.correct

    Why: CORS: Browser mechanism controlling cross-origin API access.

  16. 16. Which statement correctly describes HTTP?

    • A. Status 500 indicates the client sent invalid JSON.
    • B. Status 401 Unauthorized means authentication is missing or invalid.correct
    • C. Status 201 means the request was rejected by the server.
    • D. Status 403 means the resource was moved permanently.

    Why: 401 asks the client to authenticate; despite the name it is about authentication.

  17. 17. 201 Created is typically returned by which method?

    • A. GET.
    • B. POST creating a resource.correct
    • C. DELETE.
    • D. HEAD.

    Why: A successful resource-creating POST commonly returns 201.

  18. 18. Which HTTP concept matches this description: "Cached response is still valid; no body returned"?

    • A. 304 Not Modified.correct
    • B. Accept header.
    • C. 302 Found.
    • D. 415 Unsupported Media Type.

    Why: 304 Not Modified: Cached response is still valid; no body returned.

  19. 19. Which HTTP concept matches this description: "Asks the server which methods/headers are permitted"?

    • A. 304 Not Modified.
    • B. Accept header.
    • C. OPTIONS method.correct
    • D. 302 Found.

    Why: OPTIONS method: Asks the server which methods/headers are permitted.

  20. 20. In the context of HTTP, which of the following is a correct statement?

    • A. GET requests are designed to modify server state.
    • B. Status 201 means the request was rejected by the server.
    • C. Status 401 means the user is authenticated but lacks permission.
    • D. POST is not idempotent: repeating it may create multiple resources.correct

    Why: Duplicate POSTs can create duplicates unless idempotency keys are used.

Related API Testing topics