Skip to content
Tech Interview Prep
Technical interview guide

Working with APIs & Technical Specs

Reading and reviewing technical specs and API contracts well enough to catch problems before they ship.

Minutes to read
4
Practice MCQs
25
Interview Q&A
25
Edition
v4
Editorial status
Reviewed

Scope: OpenAPI 3.2.0, HTTP RFC 9110/9111, Problem Details RFC 9457, OAuth Security BCP RFC 9700, JSON Schema 2020-12, OWASP API Top 10:2023, gRPC, Protobuf proto3, and W3C Trace Context current 2026-08-31.

Overview

Curated: · Written: · Reviewed:

Working with APIs & Technical Specs

In one line

A technical spec is an executable contract at the wire boundary. Review whether it states what each side sends, accepts, retries and rejects, and whether it can change without breaking a real consumer. Reach for this check whenever an endpoint has more than one consumer or a mutation can be retried after an ambiguous failure.

Key definitions

  • Safe: the client does not request a state change. It says nothing about retries or authorization.
  • Idempotent: repeating the same intended request has the same intended effect. A PUT that sets a value qualifies; a POST that appends a row does not.
  • Idempotency key: a client-chosen key the server stores with the first result, so a repeat returns that result instead of acting again.
  • Object-level authorization: a check that this principal may act on this object, not only that the token carries a scope.
  • Breaking change: any change a real consumer's code or data assumptions reject, such as a removed or renamed field, a changed type, units, requiredness, enum meaning or error semantics.

Formulas and complexity

attemptsperrequest=1+p+p2 for 3 attemptsattempts per request = 1 + p + p^2 \text{ for 3 attempts}

Hmm

How it works

  1. The validator checks the document against OpenAPI and JSON Schema rules. It never sees a server response, so a passing run proves only that the document is well formed.
  2. A contract is enforced at three points: the document, the producer's response tests and each consumer's deserializer.
  3. A retry is safe only when the operation is idempotent or carries a key the server stores and checks against the first attempt.
  4. Drift enters through unknown fields, unknown enum values and numbers sent as strings. Decide per consumer whether each is tolerated or rejected.
POST /charges (Idempotency-Key k) commit charge for k connection reset before response retry POST /charges (same k) lookup k stored response 201 with stored body Client Server Store

When to use and when not to

SituationDoAvoid
Mutation with an ambiguous timeoutIdempotency key in a shared store; same key returns stored responseBlind retry with no key
Large, fast-changing collectionKeyset cursor on (created_at, id)Offset paging
Business failure such as a card decline4xx with a stable code and retryable flag5xx, which SDKs retry
Long-running import or export202 with a status resource; client polls to a terminal stateTreating any 2xx as done
Internal high-volume RPCgRPC: binary protobuf over HTTP/2 with persistent, multiplexed connectionsBrowser-facing or cacheable public reads
Per-key rate limitToken bucket or sliding windowFixed window, which can admit up to twice the limit across a boundary

Traps interviewers probe

  1. "The validator passed, so the server is right." Fix: validation proves only that the document is well formed. Test real responses against the schema with response-validation and consumer contract tests.
  2. "Retries are fine, it's a PUT." Fix: a PUT that sets a value is idempotent, but a POST that appends a transfer is not. Add an idempotency key to the POST and store its first result.
  3. "Adding an optional field is non-breaking." Fix: strict deserializers reject unknown properties. Jackson 2.16 with default settings fails on them, so run the change against each representative consumer before release.
  4. "A valid token means the caller can read it." Fix: check the object's tenant or owner against the token claims on every read. Return 404 for objects outside the caller's tenant.
  5. "Offset paging is fine." Fix: when rows are inserted at the head, offset pages repeat rows already shown. Use a keyset cursor with a unique tie-breaker.

Interview tips

Open with: "I'd check the contract at three points: the document, the producer's real responses and each consumer's deserializer. Then I'd walk the failure cases: timeout after commit, retry, unknown enum and an old client against the new server."

Expect these follow-ups:

  • How do you add a field or enum value without breaking old clients?
  • What is your retry budget, and where does the deadline come from?
  • How do you stop a cross-tenant read when the token is valid?
  • Why would you pick gRPC here, and what do you give up?
  • How does a client know an asynchronous job has finished?

30-second answer outline:

  1. Name the consumers and whether the operation is safe and idempotent (5 s).
  2. State the wire contract: status codes, error codes with a retryable flag, typed schemas with requiredness (10 s).
  3. Walk one failure: timeout after commit, retry with the same key, stored response returned (10 s).
  4. Name the test that catches drift: response validation plus a consumer contract test (5 s).

Feedback on this overview

Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.