HTTP & API Design Interview Questions for Backend Developers

Reviewed by Mark Dickie · Last updated

7 questions on this page you can answer and see marked on the spot. Go to the first one

API design is the practice of choosing resource URLs, HTTP methods, status codes, and payload shapes so a client can call a service correctly without reading its source. Interviewers use these questions to check whether you understand HTTP semantics, not just how to write a route handler. Expect to justify each choice: why PUT and PATCH differ, when 409 fits better than 400, and how you would change a response shape without breaking existing clients.

Which API design topics do interviewers test?

TopicWhat you should be able to explain
Resource namingPlural nouns such as /orders/{id}, and why verbs in paths like /getOrder fight HTTP's method semantics
Method semanticsGET and HEAD are safe, PUT and DELETE are idempotent, and POST is neither
Status codes201 with a Location header after a create, 409 for a version conflict, 422 for a valid body that breaks a business rule
PaginationCursor versus offset, and why offsets skip or repeat rows when inserts land mid-scan
Idempotency keysWhy a retried POST /payments needs a client-supplied key to avoid a double charge
VersioningURL path versus Accept header, and which changes can be additive with no version bump
Error bodiesProblem Details (RFC 9457, application/problem+json) in place of ad hoc error strings

How should you answer an API design question?

  1. Restate the resource and the actions the client needs before naming any URL.
  2. Pick the method by its semantics, then name the success status code and each failure code.
  3. Say what happens when the client retries, and whether the operation is idempotent.
  4. Name the compatibility rule you would apply if the response shape changes.
  5. Name the tradeoff you accepted, such as losing random page access with cursor pagination.

Key facts

  • Tarmac has 35 HTTP & APIs interview questions on this topic, 10 of them on this page, at difficulty 1–5 of 5.
  • Tarmac tracked 2,889 job postings asking for HTTP & APIs in October 2026.
  • Roles asking for HTTP & APIs advertise a median base salary of £77,500, across 671 job postings as of October 2026.
  • Tarmac last reviewed these HTTP & APIs interview questions on 3 November 2026.

At a glance

Questions10 shown · 35 in the bank
Difficulty1–5 of 5
FormatsMultiple choice, Fill in the blank, True / false, Ordering, Multiple answer, Short answer

What you'll review

  1. api design

Practice questions

Try one before you open the answer. Pick an option and press Check; it's marked on the spot.

A REST API needs to return a list of users. According to REST best practices, which of the following URL designs is most appropriate?#

Options

Show answer

The correct URL design is GET /users. REST best practices use plural nouns to represent resource collections and rely on HTTP methods (GET, POST, etc.) to express the action — embedding verbs like getUsers or fetchUsers in the path is redundant and non-RESTful.

Why:

REST API design favors nouns over verbs in URL paths, and uses plural resource names to represent collections. The HTTP method (GET) already conveys the action, so embedding verbs like 'get' or 'fetch' in the path is redundant and violates REST conventions. /users is a clean, noun-based, plural resource path that correctly represents a collection of user resources.

Complete the following statement about REST API design:#

Show answer

Complete the following statement about REST API design:

"A REST API endpoint that retrieves a list of all orders for a specific user might be structured as: GET /**users**/{userId}/**orders**"

Why:

RESTful URL design uses plural nouns to represent collections and nests child resources under their parent. The pattern GET /users/{userId}/orders reads naturally: 'get the orders belonging to the user with id userId'. Using nouns (not verbs) and hierarchical paths is a core REST design principle.

An HTTP PUT request is idempotent, meaning that making the same PUT request multiple times should produce the same result as making it once.#

Options

Show answer

True — HTTP PUT is idempotent. Sending the same PUT request multiple times leaves the server in the same state as sending it once, because PUT replaces (or creates) the resource at the specified URL with the given data each time. This contrasts with POST, which typically creates a new resource on every call.

Why:

Idempotency means that repeating the same operation multiple times yields the same server state as performing it once. PUT is defined as idempotent by the HTTP specification: sending PUT /users/1 with the same body replaces the resource each time, leaving the server in the identical state after the first call. This is unlike POST, which typically creates a new resource on each request and is therefore NOT idempotent.

Arrange the following HTTP status code ranges in order from the one that indicates informational responses to the one that indicates server-side errors (lowest to highest):#

Put these in order

Show answer

The correct order from lowest to highest is: 1xx Informational → 2xx Success → 3xx Redirection → 4xx Client Error → 5xx Server Error. HTTP groups status codes by their first digit, and each range has a distinct meaning: 1xx for interim responses, 2xx for successful operations, 3xx for redirects, 4xx for client mistakes, and 5xx for server failures.

Why:

HTTP status codes are grouped into five classes by their first digit: 1xx (Informational), 2xx (Success), 3xx (Redirection), 4xx (Client Error), and 5xx (Server Error). Understanding this classification is fundamental to API design and debugging — for example, knowing that a 404 is a client-side 'not found' error while a 502 is a server-side 'bad gateway' error.

A team is designing a RESTful API for a resource /orders. Which of the following practices are considered correct REST API design? Select all that apply.#

Options

Pick every one that applies.

Show answer

Correct REST design for an /orders resource calls for POST /orders to create a new order, returning 201 Created with a Location header that points to the newly created resource. Partial updates to an existing order should use PATCH /orders/42. These practices align with REST conventions: POST creates a resource and signals its location, while PATCH modifies part of an existing resource. A GET request that deletes data violates the safe, idempotent contract of GET, and PUT without a resource identifier would imply replacing the entire collection rather than a single order.

Why:

REST conventions dictate that POST /orders creates a resource and should return 201 Created alongside a Location header pointing to the newly created resource. PATCH /orders/{id} is the correct verb for a partial update. GET /orders/delete?id=42 violates the constraint that GET must be safe and idempotent — deletion should use DELETE. PUT /orders without an identifier is semantically incorrect for updating a single resource; it would imply replacing the entire collection.

A client makes a cross-origin request that triggers a CORS preflight flow, and then retrieves data from the API. Place the following events in the correct chronological order.#

Put these in order

Show answer

The correct order is: (1) Client sends the OPTIONS preflight request → (2) Server responds with CORS policy headers → (3) Browser validates the preflight response → (4) Client sends the actual request → (5) Server returns the resource. The browser-initiated OPTIONS preflight must complete and be validated before the real request is ever sent.

Why:

CORS preflight always begins with the browser automatically sending an OPTIONS request containing Origin and Access-Control-Request-Method. The server replies with the allowed origins, methods, and headers. The browser then validates those headers against the pending request. Only if the preflight succeeds does the browser dispatch the actual request, and the server finally responds with the resource plus CORS headers.

A public REST API currently returns the following response for GET /users/{id}:#

Options

Pick every one that applies.

Show answer

The breaking changes that call for a new major version are: renaming full_name to name, removing internal_score from the response, changing id from an integer to a UUID string, and returning a 200 with {} instead of a 404 when a user is not found. Each of these can make a correctly written client behave differently without any code change — a field rename or removal breaks readers of the old key, the type swap on id breaks numeric handling, and the status change breaks clients that branch on 404 to detect a missing resource. Adding a new optional field, by contrast, is an additive, non-breaking change under most REST contracts.

Why:

Breaking changes are those that can cause existing well-written clients to behave incorrectly without modification. Renaming full_name to name breaks clients that read full_name. Removing internal_score breaks clients that depend on it. Changing id's type from integer to string breaks clients that store or compare it as a number. Returning 200 instead of 404 for a missing resource breaks clients that branch on HTTP status codes to detect absence. Adding a new optional field is generally considered a non-breaking, additive change under most REST versioning contracts.

You are designing a REST API endpoint that allows a client to partially update a resource. The client wants to update only the email field of a user without touching any other fields. Explain which HTTP method you should use, why it is preferred over the alternative update method for this use case, and what a minimal correct request would look like (method, path, and body).#

Show answer

Use PATCH instead of PUT. PUT is meant for full replacement of a resource — the client must send the complete representation, and any omitted fields may be set to null or cause errors. PATCH is designed for partial updates: the client sends only the fields it wants to change. A correct request would be: PATCH /users/42 with body {"email": "[email protected]"}. The server applies only that change, leaving all other fields intact.

Why:

PATCH is the semantically correct method for partial updates per RFC 5789. PUT implies a complete replacement of the resource at the given URI; sending a partial body with PUT can lead to data loss or implementation-specific behavior. PATCH lets clients send a diff/patch document (often just a JSON subset) so only specified fields are changed. Strong candidates also note that PUT is idempotent and PATCH may be idempotent depending on the patch semantics, and that the server should return 200 or 204 on success.

HTTP/2 multiplexing completely eliminates head-of-line (HOL) blocking for all requests sharing a single connection, including scenarios involving packet loss at the TCP layer.#

Options

Show answer

False. HTTP/2 multiplexing eliminates HOL blocking at the HTTP layer by interleaving frames from multiple streams on one connection, but TCP's own HOL blocking remains: a single lost packet stalls every stream on that connection until it is retransmitted. HTTP/3 (QUIC over UDP) is what actually addresses the TCP-level HOL problem.

Why:

HTTP/2 multiplexing eliminates head-of-line blocking at the HTTP layer by allowing multiple streams over a single TCP connection. However, TCP itself still suffers from head-of-line blocking at the transport layer — a single lost packet stalls all streams on that connection. HTTP/3 (QUIC) solves this by operating over UDP with per-stream loss recovery. The statement that HTTP/2 fully eliminates head-of-line blocking is therefore false; it only solves it at the application layer, not the transport layer.

A platform team is designing a public REST API that must support multiple concurrent versions for at least 3 years. They are debating four versioning strategies:#

Show answer

Media-type (Accept header) versioning best preserves URI stability and aligns with REST constraints because the URI identifies the resource (/orders), not a versioned contract, and HTTP content negotiation (the Accept/Content-Type headers) is the standard mechanism to negotiate representation formats. Two concrete production drawbacks are: (1) Discoverability and testability — browser address bars, curl without flags, and API explorers do not easily send custom Accept headers, making manual testing and onboarding harder compared to URL versioning. (2) Caching complexity — intermediate caches (CDNs, proxies) key on the URL by default; responses differentiated only by the Accept header require a Vary: Accept response header to be cache-correct, and many CDNs handle Vary poorly or ignore it, leading to cache poisoning or under-caching.

Why:

This question tests deep knowledge of REST API design trade-offs for versioning strategies. URL path versioning (/v1/...) is simple and cache-friendly but pollutes the URI space and couples clients to implementation versions. Accept/Content-Type header versioning (media-type versioning, e.g., application/vnd.myapi.v2+json) is the most RESTful because URIs identify resources, not resource versions — it also enables content negotiation. However, it is harder to test in a browser and less visible in logs. Custom request header versioning (e.g., X-API-Version: 2) is not part of the HTTP standard and not cache-key-aware by default (requires a Vary header). Query parameter versioning (?version=2) is easy to use but semantically incorrect since query params should filter/sort resource representations, not identify API contracts. The key staff-level insight is that only media-type versioning preserves URI stability and leverages HTTP content negotiation correctly, making it the approach most aligned with REST constraints, even though URL versioning dominates in practice for pragmatic reasons.

Sources

The official documentation these questions are checked against:

Related interview questions

Job market

See http-apis salaries and hiring demand from live job postings.

The other 25 questions

This page shows 10 and marks what you pick. That's as far as a page can go. A free account opens the other 25 and keeps every answer. What you miss comes back until it's right: after a day, then at longer gaps.

Start with this topic

Free · the whole bank · 100 answers per 30 days, each marked with written feedback

Interview booked? Practise the job ad instead

What moved, monthly

One email a month when the bulletin comes out: what moved in the markets we track, and the new question topics we published. Confirm your address to join. Unsubscribe any time.