Practice contract-first API development vocabulary: design-first approach, mock servers, provider broke the contract, and Schemathesis.
0 / 37 completed
1 / 37
What does 'contract-first' or 'design-first' API development mean?
In contract-first development, teams write the API specification first and use it as the binding agreement. Both sides can develop independently — the provider implements to the spec while the consumer builds against a mock.
2 / 37
A backend developer says 'we'll generate a mock server from the contract'. What does this allow?
A mock server generated from an OpenAPI contract returns example responses matching the spec, enabling frontend/consumer teams to develop and test without waiting for the provider implementation to be complete.
3 / 37
What does it mean when a team says 'the provider broke the contract'?
Breaking the contract means the provider's API response no longer matches what was agreed in the spec, potentially breaking consumers who rely on that structure.
4 / 37
What is Schemathesis used for?
Schemathesis is a property-based testing tool that reads your OpenAPI specification and automatically generates hundreds of test cases to probe the API for crashes, 5xx errors, and spec violations.
5 / 37
In contract-first development, why do teams 'agree on the contract before implementing'?
Agreeing on the contract first decouples team dependencies: the consumer knows what to expect and can build against a mock, while the provider knows exactly what to deliver — reducing late-stage integration issues.
6 / 37
Sarah: "Hey team, I'm updating the PR description for the new user authentication API. It says we're 'implementing a consumer contract'. Does that mean we're just building an API specifically designed for other apps to use?"
Sarah is using a common misinterpretation of the term. While 'consumer contract' *can* be relevant in some contexts (like GDPR), its primary meaning within contract-first development is about establishing a clearly defined agreement between the API and its intended consumers – other applications or services. This ensures everyone understands the expected inputs, outputs, and potential error handling, preventing misunderstandings during implementation. The key is that it's a formal agreement, not just an API built for consumption.
7 / 37
Mark in the code review comments: "I'm concerned about this endpoint. The contract specifies a `PUT` request with an `id` parameter, but you're using `POST` and omitting it. This violates our agreed-upon API contract.". What is Mark primarily highlighting?
Mark is raising a critical issue regarding adherence to the API contract. The contract defines specific methods (PUT vs. POST) and required parameters (the `id` field). When the client sends an invalid request – in this case, using POST without the `id` – it's a direct violation of the agreed-upon terms, which could cause failures during integration testing or in production if not caught early. This emphasizes that contract-first development isn't just about defining the API shape; it's about ensuring consistent implementation across all systems.
8 / 37
Liam: "Okay team, I've drafted the PR description for the new product recommendation API. It states: 'The service will expose a GraphQL endpoint for retrieving recommendations based on user preferences.' Does that mean we're building a fully featured GraphQL server with all its associated schema definitions? We haven't explicitly defined a GraphQL schema."
This scenario highlights a common misunderstanding about 'contract-first' when applied to newer technologies like GraphQL. While the *concept* remains the same – defining the API's intended outcome – the 'contract' doesn't dictate the specific implementation technology (REST vs. GraphQL). The description focuses on the expected data structure and behavior, which is what contract-first development aims to ensure: clear communication about what the API *should do*, not how it should be built. Options A & B are irrelevant; option C misinterprets the scope of a contract-first approach.
9 / 37
Sarah: "Hey team, I'm updating the PR description for the new user authentication API. It says we're 'implementing a consumer contract'. Does that mean we're just building an API specifically designed for other apps to use?"
Sarah is using a common misinterpretation of the term. While 'consumer contract' *can* be relevant in some contexts (like GDPR), its primary meaning within contract-first development is about establishing a clearly defined agreement between the API and its intended consumers – other applications or services. This ensures everyone understands the expected inputs, outputs, and potential error handling, preventing misunderstandings during implementation. The key is that it's a formal agreement, not just an API built for consumption.
10 / 37
Mark in the code review comments: "I'm concerned about this endpoint. The contract specifies a `PUT` request with an `id` parameter, but you're using `POST` and omitting it. This violates our agreed-upon API contract.". What is Mark primarily highlighting?
Mark is raising a critical issue regarding adherence to the API contract. The contract defines specific methods (PUT vs. POST) and required parameters (the `id` field). When the client sends an invalid request – in this case, using POST without the `id` – it's a direct violation of the agreed-upon terms, which could cause failures during integration testing or in production if not caught early. This emphasizes that contract-first development isn't just about defining the API shape; it's about ensuring consistent implementation across all systems.
11 / 37
Liam: "Okay team, I've drafted the PR description for the new product recommendation API. It states: 'The service will expose a GraphQL endpoint for retrieving recommendations based on user preferences.' Does that mean we're building a fully featured GraphQL server with all its associated schema definitions? We haven't explicitly defined a GraphQL schema."
This scenario highlights a common misunderstanding about 'contract-first' when applied to newer technologies like GraphQL. While the *concept* remains the same – defining the API's intended outcome – the 'contract' doesn't dictate the specific implementation technology (REST vs. GraphQL). The description focuses on the expected data structure and behavior, which is what contract-first development aims to ensure: clear communication about what the API *should do*, not how it should be built. Options A & B are irrelevant; option C misinterprets the scope of a contract-first approach.
12 / 37
Sarah: "Hey team, I'm updating the PR description for the new user authentication API. It says we're 'implementing a consumer contract'. Does that mean we're just building an API specifically designed for other apps to use?"
Sarah is using a common misinterpretation of the term. While 'consumer contract' *can* be relevant in some contexts (like GDPR), its primary meaning within contract-first development is about establishing a clearly defined agreement between the API and its intended consumers – other applications or services. This ensures everyone understands the expected inputs, outputs, and potential error handling, preventing misunderstandings during implementation. The key is that it's a formal agreement, not just an API built for consumption.
13 / 37
Mark in the code review comments: "I'm concerned about this endpoint. The contract specifies a `PUT` request with an `id` parameter, but you're using `POST` and omitting it. This violates our agreed-upon API contract.". What is Mark primarily highlighting?
Mark is raising a critical issue regarding adherence to the API contract. The contract defines specific methods (PUT vs. POST) and required parameters (the `id` field). When the client sends an invalid request – in this case, using POST without the `id` – it's a direct violation of the agreed-upon terms, which could cause failures during integration testing or in production if not caught early. This emphasizes that contract-first development isn't just about defining the API shape; it's about ensuring consistent implementation across all systems.
14 / 37
Liam: "Okay team, I've drafted the PR description for the new product recommendation API. It states: 'The service will expose a GraphQL endpoint for retrieving recommendations based on user preferences.' Does that mean we're building a fully featured GraphQL server with all its associated schema definitions? We haven't explicitly defined a GraphQL schema."
This scenario highlights a common misunderstanding about 'contract-first' when applied to newer technologies like GraphQL. While the *concept* remains the same – defining the API's intended outcome – the 'contract' doesn't dictate the specific implementation technology (REST vs. GraphQL). The description focuses on the expected data structure and behavior, which is what contract-first development aims to ensure: clear communication about what the API *should do*, not how it should be built. Options A & B are irrelevant; option C misinterprets the scope of a contract-first approach.
15 / 37
Sarah: "Hey team, I'm updating the PR description for the new user authentication API. It says we're 'implementing a consumer contract'. Does that mean we're just building an API specifically designed for other apps to use?"
Sarah is using a common misinterpretation of the term. While 'consumer contract' *can* be relevant in some contexts (like GDPR), its primary meaning within contract-first development is about establishing a clearly defined agreement between the API and its intended consumers – other applications or services. This ensures everyone understands the expected inputs, outputs, and potential error handling, preventing misunderstandings during implementation. The key is that it's a formal agreement, not just an API built for consumption.
16 / 37
Mark in the code review comments: "I'm concerned about this endpoint. The contract specifies a `PUT` request with an `id` parameter, but you're using `POST` and omitting it. This violates our agreed-upon API contract.". What is Mark primarily highlighting?
Mark is raising a critical issue regarding adherence to the API contract. The contract defines specific methods (PUT vs. POST) and required parameters (the `id` field). When the client sends an invalid request – in this case, using POST without the `id` – it's a direct violation of the agreed-upon terms, which could cause failures during integration testing or in production if not caught early. This emphasizes that contract-first development isn't just about defining the API shape; it's about ensuring consistent implementation across all systems.
17 / 37
Liam: "Okay team, I've drafted the PR description for the new product recommendation API. It states: 'The service will expose a GraphQL endpoint for retrieving recommendations based on user preferences.' Does that mean we're building a fully featured GraphQL server with all its associated schema definitions? We haven't explicitly defined a GraphQL schema."
This scenario highlights a common misunderstanding about 'contract-first' when applied to newer technologies like GraphQL. While the *concept* remains the same – defining the API's intended outcome – the 'contract' doesn't dictate the specific implementation technology (REST vs. GraphQL). The description focuses on the expected data structure and behavior, which is what contract-first development aims to ensure: clear communication about what the API *should do*, not how it should be built. Options A & B are irrelevant; option C misinterprets the scope of a contract-first approach.
18 / 37
During a standup meeting, David says, "We're finalizing the API contract for the new payment processing service. It defines all the expected input and output data types, including rate limits. This helps us ensure consistency across all our integrations.". What is David primarily referring to when discussing 'the API contract' in this context?
David is referring to a core concept in contract-first development – a documented specification of the API. This 'contract' isn't a legal agreement but rather a blueprint for the API's behavior. It clarifies expectations and ensures consistent implementation across all integrations, preventing misinterpretations and integration issues. Option B is close but refers to SLAs which are part of a broader agreement, not the core API definition.
19 / 37
In a Slack channel discussing the new 'Customer Insights' API, Emily writes: 'We're using Schemathesis to generate OpenAPI definitions from our existing GraphQL schemas. This ensures we have a single source of truth for all API contracts and simplifies documentation generation.' What is the primary benefit of utilizing Schemathesis in this scenario?
Schemathesis is a tool specifically designed to bridge the gap between GraphQL schemas and API contracts like OpenAPI. By automating the generation of these contracts from existing schemas, it eliminates manual errors and ensures consistency across all API definitions. This reduces development time and improves overall API management.
20 / 37
During a code review, John comments: "The contract specifies that this endpoint should return a JSON object with a 'status' field indicating success or failure and a 'message' describing the outcome. However, you're returning a plain text error message directly in the response body. This deviates from the defined contract.". What is John highlighting regarding API contracts?
John is emphasizing the critical role of adhering to documented specifications – the 'contract' in this case. Deviating from defined formats and data structures leads to inconsistencies and potential integration issues with other systems consuming the API. Following the contract ensures predictable behavior and seamless interoperability.
21 / 37
Maria, a senior developer, is drafting the PR description for a new 'Inventory Management' API. She writes: 'This service will expose an HTTP endpoint that accepts a JSON payload containing product IDs and quantities to update inventory levels.' What does Maria's statement primarily illustrate regarding contract-first development?
Maria's statement explicitly defines the expected input (JSON payload with product IDs and quantities) and output (updating inventory levels). This is precisely what a contract-first approach focuses on – clearly documenting the API's interface to ensure consistent consumption by other systems. It establishes a 'contract' that developers can refer to when building integrations.
22 / 37
During a team retrospective, Ben asks: "Why do we spend so much time creating these API contracts before even writing any code? Isn't that just extra work?" Which of the following best explains the value proposition of contract-first development?
The core benefit of contract-first development lies in proactive risk mitigation. Defining the API contract early on allows teams to identify potential integration challenges, clarify requirements, and prevent costly rework later. This shift-left approach dramatically reduces the likelihood of integration problems and improves overall development efficiency.
23 / 37
During a standup meeting, David says, "We're finalizing the API contract for the new payment processing service. It defines all the expected input and output data types, including rate limits. This helps us ensure consistency across all our integrations.". What is David primarily referring to when discussing 'the API contract' in this context?
David is referring to a core concept in contract-first development – a documented specification of the API. This 'contract' isn't a legal agreement but rather a blueprint for the API's behavior. It clarifies expectations and ensures consistent implementation across all integrations, preventing misinterpretations and integration issues. Option B is close but refers to SLAs which are part of a broader agreement, not the core API definition.
24 / 37
In a Slack channel discussing the new 'Customer Insights' API, Emily writes: 'We're using Schemathesis to generate OpenAPI definitions from our existing GraphQL schemas. This ensures we have a single source of truth for all API contracts and simplifies documentation generation.' What is the primary benefit of utilizing Schemathesis in this scenario?
Schemathesis is a tool specifically designed to bridge the gap between GraphQL schemas and API contracts like OpenAPI. By automating the generation of these contracts from existing schemas, it eliminates manual errors and ensures consistency across all API definitions. This reduces development time and improves overall API management.
25 / 37
During a code review, John comments: "The contract specifies that this endpoint should return a JSON object with a 'status' field indicating success or failure and a 'message' describing the outcome. However, you're returning a plain text error message directly in the response body. This deviates from the defined contract.". What is John highlighting regarding API contracts?
John is emphasizing the critical role of adhering to documented specifications – the 'contract' in this case. Deviating from defined formats and data structures leads to inconsistencies and potential integration issues with other systems consuming the API. Following the contract ensures predictable behavior and seamless interoperability.
26 / 37
Maria, a senior developer, is drafting the PR description for a new 'Inventory Management' API. She writes: 'This service will expose an HTTP endpoint that accepts a JSON payload containing product IDs and quantities to update inventory levels.' What does Maria's statement primarily illustrate regarding contract-first development?
Maria's statement explicitly defines the expected input (JSON payload with product IDs and quantities) and output (updating inventory levels). This is precisely what a contract-first approach focuses on – clearly documenting the API's interface to ensure consistent consumption by other systems. It establishes a 'contract' that developers can refer to when building integrations.
27 / 37
During a team retrospective, Ben asks: "Why do we spend so much time creating these API contracts before even writing any code? Isn't that just extra work?" Which of the following best explains the value proposition of contract-first development?
The core benefit of contract-first development lies in proactive risk mitigation. Defining the API contract early on allows teams to identify potential integration challenges, clarify requirements, and prevent costly rework later. This shift-left approach dramatically reduces the likelihood of integration problems and improves overall development efficiency.
28 / 37
During a standup meeting, David says, "We're finalizing the API contract for the new payment processing service. It defines all the expected input and output data types, including rate limits. This helps us ensure consistency across all our integrations.". What is David primarily referring to when discussing 'the API contract' in this context?
David is referring to a core concept in contract-first development – a documented specification of the API. This 'contract' isn't a legal agreement but rather a blueprint for the API's behavior. It clarifies expectations and ensures consistent implementation across all integrations, preventing misinterpretations and integration issues. Option B is close but refers to SLAs which are part of a broader agreement, not the core API definition.
29 / 37
In a Slack channel discussing the new 'Customer Insights' API, Emily writes: 'We're using Schemathesis to generate OpenAPI definitions from our existing GraphQL schemas. This ensures we have a single source of truth for all API contracts and simplifies documentation generation.' What is the primary benefit of utilizing Schemathesis in this scenario?
Schemathesis is a tool specifically designed to bridge the gap between GraphQL schemas and API contracts like OpenAPI. By automating the generation of these contracts from existing schemas, it eliminates manual errors and ensures consistency across all API definitions. This reduces development time and improves overall API management.
30 / 37
During a code review, John comments: "The contract specifies that this endpoint should return a JSON object with a 'status' field indicating success or failure and a 'message' describing the outcome. However, you're returning a plain text error message directly in the response body. This deviates from the defined contract.". What is John highlighting regarding API contracts?
John is emphasizing the critical role of adhering to documented specifications – the 'contract' in this case. Deviating from defined formats and data structures leads to inconsistencies and potential integration issues with other systems consuming the API. Following the contract ensures predictable behavior and seamless interoperability.
31 / 37
Maria, a senior developer, is drafting the PR description for a new 'Inventory Management' API. She writes: 'This service will expose an HTTP endpoint that accepts a JSON payload containing product IDs and quantities to update inventory levels.' What does Maria's statement primarily illustrate regarding contract-first development?
Maria's statement explicitly defines the expected input (JSON payload with product IDs and quantities) and output (updating inventory levels). This is precisely what a contract-first approach focuses on – clearly documenting the API's interface to ensure consistent consumption by other systems. It establishes a 'contract' that developers can refer to when building integrations.
32 / 37
During a team retrospective, Ben asks: "Why do we spend so much time creating these API contracts before even writing any code? Isn't that just extra work?" Which of the following best explains the value proposition of contract-first development?
The core benefit of contract-first development lies in proactive risk mitigation. Defining the API contract early on allows teams to identify potential integration challenges, clarify requirements, and prevent costly rework later. This shift-left approach dramatically reduces the likelihood of integration problems and improves overall development efficiency.
33 / 37
During a standup meeting, David says, "We're finalizing the API contract for the new payment processing service. It defines all the expected input and output data types, including rate limits. This helps us ensure consistency across all our integrations.". What is David primarily referring to when discussing 'the API contract' in this context?
David is referring to a core concept in contract-first development – a documented specification of the API. This 'contract' isn't a legal agreement but rather a blueprint for the API's behavior. It clarifies expectations and ensures consistent implementation across all integrations, preventing misinterpretations and integration issues. Option B is close but refers to SLAs which are part of a broader agreement, not the core API definition.
34 / 37
In a Slack channel discussing the new 'Customer Insights' API, Emily writes: 'We're using Schemathesis to generate OpenAPI definitions from our existing GraphQL schemas. This ensures we have a single source of truth for all API contracts and simplifies documentation generation.' What is the primary benefit of utilizing Schemathesis in this scenario?
Schemathesis is a tool specifically designed to bridge the gap between GraphQL schemas and API contracts like OpenAPI. By automating the generation of these contracts from existing schemas, it eliminates manual errors and ensures consistency across all API definitions. This reduces development time and improves overall API management.
35 / 37
During a code review, John comments: "The contract specifies that this endpoint should return a JSON object with a 'status' field indicating success or failure and a 'message' describing the outcome. However, you're returning a plain text error message directly in the response body. This deviates from the defined contract.". What is John highlighting regarding API contracts?
John is emphasizing the critical role of adhering to documented specifications – the 'contract' in this case. Deviating from defined formats and data structures leads to inconsistencies and potential integration issues with other systems consuming the API. Following the contract ensures predictable behavior and seamless interoperability.
36 / 37
Maria, a senior developer, is drafting the PR description for a new 'Inventory Management' API. She writes: 'This service will expose an HTTP endpoint that accepts a JSON payload containing product IDs and quantities to update inventory levels.' What does Maria's statement primarily illustrate regarding contract-first development?
Maria's statement explicitly defines the expected input (JSON payload with product IDs and quantities) and output (updating inventory levels). This is precisely what a contract-first approach focuses on – clearly documenting the API's interface to ensure consistent consumption by other systems. It establishes a 'contract' that developers can refer to when building integrations.
37 / 37
During a team retrospective, Ben asks: "Why do we spend so much time creating these API contracts before even writing any code? Isn't that just extra work?" Which of the following best explains the value proposition of contract-first development?
The core benefit of contract-first development lies in proactive risk mitigation. Defining the API contract early on allows teams to identify potential integration challenges, clarify requirements, and prevent costly rework later. This shift-left approach dramatically reduces the likelihood of integration problems and improves overall development efficiency.
What will I practice in "Contract-First API Development Vocabulary Quiz"?
This is an API Contract Testing exercise set. It walks through 37 scenario-based multiple-choice questions built around real usage of API Contract Testing terminology that IT professionals encounter on the job.
Is this exercise free to use?
Yes. Every exercise on CoderSlingo, including this one, is free to complete with no account, sign-up, or paywall.
How many questions are in this exercise?
This set contains 37 questions. Each one shows immediate feedback and a detailed explanation after you answer, so you learn the correct usage right away rather than waiting for a final score.
Do I need prior experience to complete this exercise?
No prior experience is required. Each question includes a full explanation covering the reasoning behind the correct answer, so the exercise itself teaches the API Contract Testing vocabulary as you go.
Can I retry the exercise if I get questions wrong?
Yes — use the "Try again" button on the results screen to reset your answers and go through all the questions again. There is no limit on attempts.
Is my progress saved?
Your answers and score for the current session are tracked in the browser as you go. No account or login is needed, and there is nothing to install.
What if I don't understand a term used in a question?
Read the explanation shown after you answer each question — it breaks down the correct term in plain English with a real-world example. You can also check the site Glossary for quick definitions.
How is this different from reading a blog article on the topic?
Exercises like this one are interactive drills that test and reinforce specific vocabulary through multiple-choice questions, while blog articles explain concepts in prose. Practising here after reading builds active recall, not just passive recognition.
Where can I find more API Contract Testing exercises?
See the API Contract Testing exercises hub for the full set of related pages, or browse all exercise categories from the main Exercises index.
Can I use this exercise to prepare for a technical interview?
Yes — API Contract Testing vocabulary comes up often in technical discussions and interviews. Pair this exercise with our dedicated Interview Preparation section for role-specific practice.