yoklainterview sim

Backend Interview Questions

3300 verified Backend interview questions — solve with answers, learn from explanations, test yourself in a real simulation.

Try the real simulation →

Sample questions

API DesignDifficulty 1
In HTTP, GET is classified as a safe method. What does that mean?
  • aThe request is automatically encrypted by the browser, which is what makes it safe to send
  • bIt is meant only to read data and is not expected to change server state
  • cThe server guarantees the request can never return an error
  • dIt can only be sent to endpoints that require no authentication
Explanation:Safe means the client does not request any state change — which is why GETs can be cached, prefetched and retried freely. "Safe" is about semantics, not security (a): encryption comes from HTTPS, not from the method.
API DesignDifficulty 2
Which HTTP method is NOT idempotent?
  • aGET
  • bDELETE
  • cPOST
  • dPUT
Explanation:Idempotent means repeating the same request leaves the server in the same state as sending it once. POST typically creates a new resource on every call, so repeats multiply the effect. DELETE stays idempotent even when a repeat returns 404 — the resource is equally gone.
API DesignDifficulty 1
A POST request successfully creates a new resource. Which status code communicates this most precisely?
  • a200 OK
  • b204 No Content
  • c201 Created
  • d202 Accepted
Explanation:201 Created states that a new resource now exists, typically with a Location header pointing at it. 200 is a generic success, 204 is success without a body, and 202 (d) means the request was only queued for later processing — creation has not necessarily happened yet.
API DesignDifficulty 2
What is the difference between 401 Unauthorized and 403 Forbidden?
  • a401 means the user lacks permission for the resource; 403 means the request carries no valid credentials
  • b401 means missing or invalid credentials; 403 means the authenticated user lacks permission
  • cThey are interchangeable; picking one is a team style preference
  • d401 is used only for expired sessions; 403 only for banned accounts
Explanation:401 says "prove who you are" (an authentication problem), while 403 says "I know who you are, and you may not do this" (an authorization problem). Option (a) states it exactly backwards, which is the classic mix-up.
API DesignDifficulty 3
The same DELETE request is sent twice:
DELETE /orders/42   ->  204 No Content
DELETE /orders/42   ->  404 Not Found

The two calls return different status codes. Is DELETE's idempotency violated?
  • aNo — idempotency is about server state, and the order is equally deleted after both calls
  • bYes — an idempotent method must return the same status code on every repeat, not merely reach the same end state
  • cYes — the server should keep returning 204 until the client stops retrying
  • dNo — because DELETE was never an idempotent method in the first place
Explanation:Idempotency promises that repeating the request leaves the server in the same state, not that the response is byte-identical. After both calls the order is gone; the 404 merely reports that it no longer exists. Expecting identical status codes (b) is the most common misreading of the definition.
API DesignDifficulty 1
What is the difference between PUT and PATCH?
  • aPUT applies a partial change; PATCH replaces the whole resource
  • bPUT can only create resources; PATCH can only update them
  • cThey behave identically; PATCH is just the newer name for PUT
  • dPUT replaces the entire resource; PATCH applies a partial modification
Explanation:PUT sends the full representation and the server replaces the resource with it — which also makes PUT idempotent. PATCH sends only the changes to apply. Option (a) is the same fact reversed, the most common confusion between the two.

Test yourself against the 3300-question Backend bank.

Start interview