Contract Testing interview questions — Easy

125 easy-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 easy level, interviewers are typically checking that you know the fundamentals and can describe them precisely — definitions, defaults, and the basic mechanics. Work through these, then explain your answer out loud; the second part is what interviews actually test.

20 example questions

  1. 1. Which of the following best describes OpenAPI specification in Contract Testing?

    • A. Broker check confirming compatible versions before release.
    • B. Writing the API spec before implementation.
    • C. Precondition the provider sets up before verification.
    • D. Machine-readable description of a REST API.correct

    Why: OpenAPI specification: Machine-readable description of a REST API.

  2. 2. In the context of Contract Testing, backward compatibility is best described as:

    • A. Changes that do not break existing consumers.correct
    • B. JSON document capturing consumer-provider interactions.
    • C. Precondition the provider sets up before verification.
    • D. Machine-readable description of a REST API.

    Why: backward compatibility: Changes that do not break existing consumers.

  3. 3. In Contract Testing, what does backward compatibility do or refer to?

    • A. Service that implements and serves the API.
    • B. Changes that do not break existing consumers.correct
    • C. JSON document capturing consumer-provider interactions.
    • D. Service or app that calls the API.

    Why: backward compatibility: Changes that do not break existing consumers.

  4. 4. Which of the following best describes contract-first design in Contract Testing?

    • A. Writing the API spec before implementation.correct
    • B. Service or app that calls the API.
    • C. Changes that do not break existing consumers.
    • D. Machine-readable description of a REST API.

    Why: contract-first design: Writing the API spec before implementation.

  5. 5. What is the purpose of contract-first design in Contract Testing?

    • A. Changes that do not break existing consumers.
    • B. Writing the API spec before implementation.correct
    • C. Service that implements and serves the API.
    • D. Broker check confirming compatible versions before release.

    Why: contract-first design: Writing the API spec before implementation.

  6. 6. Which of the following best describes provider state in Contract Testing?

    • A. JSON document capturing consumer-provider interactions.
    • B. Precondition the provider sets up before verification.correct
    • C. Writing the API spec before implementation.
    • D. Broker check confirming compatible versions before release.

    Why: provider state: Precondition the provider sets up before verification.

  7. 7. Which of the following best describes can-i-deploy in Contract Testing?

    • A. Service or app that calls the API.
    • B. Changes that do not break existing consumers.
    • C. Broker check confirming compatible versions before release.correct
    • D. Machine-readable description of a REST API.

    Why: can-i-deploy: Broker check confirming compatible versions before release.

  8. 8. In Contract Testing, what does OpenAPI specification do or refer to?

    • A. Changes that do not break existing consumers.
    • B. Machine-readable description of a REST API.correct
    • C. Broker check confirming compatible versions before release.
    • D. Service that implements and serves the API.

    Why: OpenAPI specification: Machine-readable description of a REST API.

  9. 9. Which of the following best describes pact file in Contract Testing?

    • A. JSON document capturing consumer-provider interactions.correct
    • B. Precondition the provider sets up before verification.
    • C. Service that implements and serves the API.
    • D. Broker check confirming compatible versions before release.

    Why: pact file: JSON document capturing consumer-provider interactions.

  10. 10. What is the purpose of backward compatibility in Contract Testing?

    • A. Changes that do not break existing consumers.correct
    • B. Machine-readable description of a REST API.
    • C. Precondition the provider sets up before verification.
    • D. JSON document capturing consumer-provider interactions.

    Why: backward compatibility: Changes that do not break existing consumers.

  11. 11. In Contract Testing, what does provider state do or refer to?

    • A. Broker check confirming compatible versions before release.
    • B. Precondition the provider sets up before verification.correct
    • C. Service that implements and serves the API.
    • D. Service or app that calls the API.

    Why: provider state: Precondition the provider sets up before verification.

  12. 12. Which of the following best describes backward compatibility in Contract Testing?

    • A. Service or app that calls the API.
    • B. JSON document capturing consumer-provider interactions.
    • C. Changes that do not break existing consumers.correct
    • D. Writing the API spec before implementation.

    Why: backward compatibility: Changes that do not break existing consumers.

  13. 13. In Contract Testing, what does contract-first design do or refer to?

    • A. Precondition the provider sets up before verification.
    • B. Service that implements and serves the API.
    • C. Writing the API spec before implementation.correct
    • D. Broker check confirming compatible versions before release.

    Why: contract-first design: Writing the API spec before implementation.

  14. 14. What is the purpose of OpenAPI specification in Contract Testing?

    • A. Changes that do not break existing consumers.
    • B. Precondition the provider sets up before verification.
    • C. Machine-readable description of a REST API.correct
    • D. Service or app that calls the API.

    Why: OpenAPI specification: Machine-readable description of a REST API.

  15. 15. What is the purpose of can-i-deploy in Contract Testing?

    • A. Precondition the provider sets up before verification.
    • B. Broker check confirming compatible versions before release.correct
    • C. Machine-readable description of a REST API.
    • D. Service or app that calls the API.

    Why: can-i-deploy: Broker check confirming compatible versions before release.

  16. 16. What is the purpose of pact file in Contract Testing?

    • A. Writing the API spec before implementation.
    • B. Machine-readable description of a REST API.
    • C. Broker check confirming compatible versions before release.
    • D. JSON document capturing consumer-provider interactions.correct

    Why: pact file: JSON document capturing consumer-provider interactions.

  17. 17. Which of the following best describes consumer in Contract Testing?

    • A. Service or app that calls the API.correct
    • B. Broker check confirming compatible versions before release.
    • C. Precondition the provider sets up before verification.
    • D. Service that implements and serves the API.

    Why: consumer: Service or app that calls the API.

  18. 18. In Contract Testing, what does pact file do or refer to?

    • A. Machine-readable description of a REST API.
    • B. Service or app that calls the API.
    • C. JSON document capturing consumer-provider interactions.correct
    • D. Writing the API spec before implementation.

    Why: pact file: JSON document capturing consumer-provider interactions.

  19. 19. What is the purpose of provider state in Contract Testing?

    • A. Changes that do not break existing consumers.
    • B. Precondition the provider sets up before verification.correct
    • C. JSON document capturing consumer-provider interactions.
    • D. Service that implements and serves the API.

    Why: provider state: Precondition the provider sets up before verification.

  20. 20. Which of the following best describes provider in Contract Testing?

    • A. Precondition the provider sets up before verification.
    • B. Broker check confirming compatible versions before release.
    • C. Service that implements and serves the API.correct
    • D. JSON document capturing consumer-provider interactions.

    Why: provider: Service that implements and serves the API.

Related API Testing topics