InterviewStack.io LogoInterviewStack.io

API and Contract Testing Questions

Testing services and their interfaces directly. Covers REST and other API testing, request/response and schema validation, status and error handling, and contract testing between producers and consumers. Includes service-level and integration testing without a UI.

MediumTechnical
61 practiced

You're adding a new field to a public JSON API response that third-party clients already consume in production. Walk through a rollout plan that keeps existing clients working: what you'd validate before shipping, how you'd communicate the change, and how you'd monitor for client-side errors afterward.

EasyTechnical
96 practiced

Design a set of test cases that verify an endpoint's idempotency guarantees for its POST, PUT, and DELETE operations. Cover retried requests, requests that arrive concurrently, and what should happen if a request partially succeeds before failing.

HardTechnical
65 practiced

A service you depend on keeps shipping changes that break your integration with it, and the breakage is only caught after it reaches production. Propose both a technical and a process fix: what would you put in place so a breaking change is caught before it ships, who should own the tests that catch it, and how would you pilot the change and show it actually reduced regressions?

HardSystem Design
58 practiced

Design a consumer-driven contract testing rollout for an organization with dozens to hundreds of microservices owned by different teams. Cover how contracts are authored and versioned, how they are stored and published, what a provider verification pipeline looks like, and how you would handle a backward-incompatible change without breaking a deployment.

HardTechnical
64 practiced

Several consumer teams have each published a contract against the same provider API, and their expectations conflict with each other. How would you detect that conflict, and what technical and organizational approaches would you use to resolve it without breaking any of the consumers already in production?

Unlock Full Question Bank

Get access to all 18 API and Contract Testing interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.