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. Which of the following statements about Contract Testing is FALSE?
- A. Contract tests are slower and flakier than full end-to-end tests by nature.correct
- B. Contract testing verifies that a consumer and provider agree on the API's request/response structure.
- C. Contract tests are faster and more stable than full end-to-end integration tests.
- 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.
2. Regarding Contract Testing, which of the following is a false statement?
- A. Provider states set up required data before verifying an interaction.
- B. Contract tests are slower and flakier than full end-to-end tests by nature.correct
- C. A Pact Broker stores contracts and verification results, enabling can-i-deploy checks.
- D. Provider verification replays consumer interactions against the real provider.
Why: The selected statement is false. The other options are accurate statements about Contract Testing.
3. Which statement about Contract Testing is NOT correct?
- A. Contract testing verifies that a consumer and provider agree on the API's request/response structure.
- B. In consumer-driven contracts, the provider dictates what consumers must accept.correct
- C. Contract tests are faster and more stable than full end-to-end integration tests.
- D. Provider verification replays consumer interactions against the real provider.
Why: The selected statement is false. The other options are accurate statements about Contract Testing.
4. 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. Provider states set up required data before verifying an interaction.
- D. Schema validation against an OpenAPI spec is a provider-driven contract approach.
Why: The selected statement is false. The other options are accurate statements about Contract Testing.