Contract Testing interview questions — Hard
123 hard-level Contract Testing questions from our API Testing bank, each with the correct answer and an explanation of why it is correct.
This topic slice is available to practise but is not yet part of our indexed set.
What this covers
Contract Testing appears throughout API Testing interviews. At hard level, interviewers are typically checking depth under pressure — edge cases, failure modes, performance characteristics, and the trade-offs you accepted. Work through these, then explain your answer out loud; the second part is what interviews actually test.
4 example questions
1. Regarding Contract Testing, which of the following is a false statement?
- A. Adding an optional new response field always breaks consumer contracts.correct
- B. Contract tests are faster and more stable than full end-to-end integration tests.
- C. Contract testing verifies that a consumer and provider agree on the API's request/response structure.
- D. In consumer-driven contract testing, the consumer defines expectations the provider must verify.
Why: The selected statement is false. The other options are accurate statements about Contract Testing.
2. Which of the following statements about Contract Testing is FALSE?
- A. Contract testing requires deploying all microservices together in one environment.correct
- B. Schema validation against an OpenAPI spec is a provider-driven contract approach.
- C. In consumer-driven contract testing, the consumer defines expectations the provider must verify.
- D. Contract tests are faster and more stable than full end-to-end integration tests.
Why: The selected statement is false. The other options are accurate statements about Contract Testing.
3. Identify the INCORRECT statement about Contract Testing:
- A. In consumer-driven contracts, the provider dictates what consumers must accept.correct
- B. Breaking changes like removing a response field are exactly what contract tests catch.
- C. A Pact Broker stores contracts and verification results, enabling can-i-deploy checks.
- D. In consumer-driven contract testing, the consumer defines expectations the provider must verify.
Why: The selected statement is false. The other options are accurate statements about Contract Testing.
4. Which statement about Contract Testing is NOT correct?
- A. Contract tests are slower and flakier than full end-to-end tests by nature.correct
- B. Provider verification replays consumer interactions against the real provider.
- C. Contract testing verifies that a consumer and provider agree on the API's request/response structure.
- D. Provider states set up required data before verifying an interaction.
Why: The selected statement is false. The other options are accurate statements about Contract Testing.