QA & Software Testing

API & Contract Testing

6 practice questions. Free questions open a full answer guide; the rest unlock with Pro.

  • What is API contract testing, and how is it different from running a full integration test between two services? Junior level
  • Your team owns a provider API that three downstream services consume, and a backwards-incompatible change you shipped quietly broke one of them in production. How would you use consumer-driven contract testing to make that class of break impossible to ship, and where does contract testing stop being enough?Go Pro Senior level
  • Adding a new optional field to an API response is usually safe, but removing one isn't. Why does that matter for contract testing, and how would a contract test catch the difference?Go Pro Junior level
  • Walk me through how you'd set up consumer-driven contract testing between two services owned by different teams, and what it catches that integration tests don't.Go Pro Mid level
  • A teammate argues that consumer-driven contract tests give a false sense of safety because the provider verifies against a mock of what the consumer claims it sends, not against the consumer's real code. How do you respond, and how do you keep contracts from drifting away from real behavior?Go Pro Senior level
  • Your team uses contract tests with matchers instead of exact values. Why use matchers, and what's the risk if you make the matchers too loose?Go Pro Mid level
Want questions matched to your role? Paste a job title, job description, or CV for a personalized set, or go Pro to unlock the full bank.