Sign inStart assessment
← All assessment guides

API Contract Change Review: An Employer Developer Work-Sample Audit

A developer may produce code that passes local tests yet breaks clients when an API contract changes. This employer work sample asks candidates to review compatibility, error semantics, duplicate requests, pagination and observability using a fictional payment and order API. It is not a broad software developer skills test, and it does not imply that Talentrenza Assess runs code or provides an API testing sandbox.

A developer may produce code that passes local tests yet breaks clients when an API contract changes. This employer work sample asks candidates to review compatibility, error semantics, duplicate requests, pagination and observability using a fictional payment and order API. It is not a broad software developer skills test, and it does not imply that Talentrenza Assess runs code or provides an API testing sandbox.

The examples deliberately avoid framework trivia. Candidates should be able to explain the risk from a written contract and propose a verifiable correction. Employers should provide the same assumed API conventions to everyone and not penalise an answer merely because a different real-world service uses another convention.

Assessment setup and source material

Give candidates a versioned API contract, a short changelog, sample requests and responses, a fictional client integration note and a compatibility policy. Ask them to annotate each proposed change as safe, potentially breaking, underspecified or requiring migration. The review should produce concrete tests and rollout precautions, not just a generic recommendation to “use versioning.”

The example service stores amounts in integer minor currency units, uses a client-provided idempotency key for payment creation and documents page-size limits. These are fictional contract rules, not universal API standards.

Worked case 1: A required request field appears without migration

Existing contract: An order-creation request requires `customerid` and `amountminor`. The proposed release also requires `sales_region`, but existing clients do not send it.

Expected review: Mark the change breaking for existing clients unless a compatible default, negotiated version or coordinated migration is provided. Request evidence of client usage, a transition plan and a contract test using the old payload. A field can be valuable for the business while still creating a compatibility defect.

Strong test: Submit the previously valid request to the candidate release and confirm whether it still receives the documented success response. If it fails solely because `sales_region` is absent, the old client contract has changed.

Worked case 2: A response field is renamed

Existing contract: The response contains `totalminor`. The proposed response replaces it with `amountminor` and removes `totalminor` immediately. One documented client reads `totalminor` to show a receipt.

Expected review: Identify the removal as a breaking response change. Recommend retaining the old field during a migration window or introducing an explicitly versioned contract, and test both old and new clients. Do not assume consumers ignore unknown or missing fields; the supplied client evidence says otherwise.

Reviewer reasoning: The candidate should trace a specific consumer impact, not merely recite “never rename fields.”

Worked case 3: Repeated payment requests and idempotency

Existing contract: A payment creation request includes idempotency key `K-77`. The first request creates payment `P-301`. A network timeout prevents the client from seeing the response, so it retries with the same key and identical body.

Expected review: Under the supplied policy, the retry must not create a second payment. The service should return the documented prior result or a clearly defined equivalent response tied to `P-301`. A retry using the same key but a materially different body should follow the documented conflict behaviour, not silently overwrite the first transaction.

Test design: Assert that two identical requests with `K-77` produce one created payment record. Verify behaviour across a simulated timeout and check that sensitive request details are not unnecessarily logged. The candidate need not claim that every public API implements idempotency identically.

Worked case 4: Minor units and arithmetic in a refund

Existing contract: `amount_minor` is an integer number of minor units; in this fictional currency, 100 minor units equal one major unit. An original payment is 125,000 minor units. A partial refund is 25,000 minor units.

Expected calculation: Original payment = 1,250.00 major units. Refund = 250.00 major units. Remaining net amount = 100,000 minor units, or 1,000.00 major units. A client that divides the original amount twice or treats 125,000 as a major-unit value would materially misstate the amount.

Review note: The contract should state the currency and minor-unit rule explicitly; not all currencies use two decimal places. The case tests whether the candidate reads the supplied data contract rather than assuming one global currency format.

Worked case 5: Error codes and client expectations

Existing contract: A malformed request returns HTTP 400 with a machine-readable error code. The proposed release returns HTTP 200 with a JSON body containing `success: false` for the same invalid request. The client retries every 200 response as if the operation succeeded.

Expected review: Flag the semantic mismatch and demonstrate the client impact. Recommend preserving the documented HTTP status and structured error code, or managing a deliberate migration with client updates and tests. The exercise does not require a universal claim that a particular HTTP status must be used for every validation error.

Test: Send a request missing a required field, assert the documented failure status and verify that no order is created. Reviewers should credit candidates who articulate the failure mode and propose a consistent, testable contract.

Worked case 6: Pagination silently drops records

Existing contract: The list endpoint returns at most ten records per page and includes a next-page token until the result set is exhausted. A test account has 23 matching records.

Expected calculation: The minimum number of full/partial pages is ceil(23 ÷ 10) = 3. A client that fetches only two pages can see at most 20 records and miss 3. The candidate should verify the final token behaviour and whether records can move between pages under concurrent updates.

Review note: A stable cursor or documented snapshot behaviour may be important for changing datasets. Do not claim that simple page numbers guarantee consistent pagination in a mutable collection.

Worked case 7: A rate-limit change without a client notice

Existing contract: A client may send 60 requests per minute. A proposed change reduces this to 30 without updating the documentation or retry guidance. A documented integration sometimes sends 45 requests per minute.

Expected review: The integration exceeds the new nominal limit by 15 requests per minute. Identify potential throttling and request a rollout notice, clear limit headers or documented error behaviour, and a client backoff plan. The candidate should avoid promising an exact number of failures because rate-limit algorithms may use different windows or burst allowances.

Strong response: Explain which contract tests and load simulations would reveal the change, while acknowledging that a simple per-minute count does not fully model burst handling.

Worked case 8: A new field exposes information unnecessarily

Existing contract: An order response is visible to several internal teams. The proposed release adds a full customer identity document number to every response, although the documented consumer only needs the last four characters.

Expected review: Challenge the data-minimisation decision, identify which clients genuinely need the field, propose a less sensitive representation and seek security/privacy review. Do not publish the value in logs or sample screenshots. The exercise is about contract design and least-necessary data exposure, not guessing a specific jurisdiction's privacy statute.

Test: Verify that the public or broadly accessible response omits the full identifier and that access rules are documented for any restricted endpoint that legitimately needs it.

Example contract-review worksheet

ChangeCompatibility findingRequired evidenceCandidate recommendation
New required `sales_region`Breaking for old payloadsOld-client contract testDefault or versioned migration
Removed `total_minor`Breaking for known readerClient usage tracePreserve during transition
Repeated `K-77` requestDuplicate-payment riskIdempotency testOne payment creation
Pagination of 23 recordsMissing-record riskToken traversal testRetrieve all three pages
Full identity number in responseUnnecessary exposure riskData-use justificationMinimise returned fields

The worksheet records what is known and what must be tested. It should not be converted into a yes/no checklist that rewards memorised slogans without technical explanation.

Scoring and moderation

CriterionMaximum pointsWhat the reviewer checks
Correct compatibility classification30Breaking versus safe changes explained
Specific contract tests25Old payloads, retries, errors and pagination
Numerical and data-format reasoning15Minor units, pages and rate-limit arithmetic
Security and privacy judgement15Minimal exposure and traceable review
Migration and communication plan10Client impact and staged rollout
Clarity and evidence limits5No unsupported universal claims
Total100Illustrative only

An example score of 24 + 21 + 14 + 12 + 8 + 4 = 83/100. It is not a validated hiring threshold. Employers should pilot the case pack with engineers familiar with the role and agree on acceptable alternative approaches before testing candidates.

Fairness and implementation safeguards

Provide the fictional API conventions in writing, including the idempotency policy and currency-unit definition. Allow documentation and a text editor if those reflect the real job. Do not require candidates to execute live payment requests, use personal credentials or access a production system. Offer an accessible text version of diagrams and avoid a time limit that turns a careful review into a typing-speed test.

Have two reviewers independently mark a pilot sample, compare rationales and record where the rubric is ambiguous. A candidate may propose a backward-compatible default or explicit versioning; both can be sound if supported by the client constraints. The reviewer should score the reasoning, tests and risk communication rather than preference for one technology stack.

For the broader technical-hiring context, see the existing IT and software developer assessment tests guide. For review consistency, the skills assessment scoring rubric calibration guide offers a separate employer quality framework.

Frequently asked questions

Is adding a field always backward-compatible?

No. An optional response field may be harmless for some clients, but a newly required request field can reject previously valid calls. Assess the supplied client contract and parsing behaviour.

Is idempotency the same as returning the same HTTP status?

Not necessarily. The central contract here is preventing duplicate payment creation for an identical retry key. Exact response semantics must be specified and tested.

Why use integer minor units?

The fictional contract uses integers to avoid ambiguity in money representation. Candidates must still read the currency-specific unit rule; the number of minor units per major unit is not universal.

Can a candidate use an alternative migration design?

Yes. A compatible default, transitional dual field or versioned endpoint may all be defensible depending on the stated constraints. Require the candidate to explain the tests and trade-offs.

Does this exercise prove a developer can build secure APIs?

No. It samples contract-review judgement only. A hiring decision should consider other role-relevant evidence and the limits of this fictional exercise.

Does Talentrenza run this API test automatically?

No such functionality is claimed. The article is an employer guide to designing and reviewing an illustrative work sample.

Conclusion

A useful API review identifies which existing consumer can break, what evidence would prove it and how to release the change safely. The quality of that explanation is more informative than an unqualified “pass” or “fail” on a fashionable coding puzzle.

Explore Talentrenza Assess assessments →

API Contract Change Review | Developer Work-Sample Guide | Talentrenza Assess