IntermediateGraphQL & API GatewayAPI gatewayBFFRate limiting
API Gateway Patterns — Vocabulary
5 exercises — Learn API gateway vocabulary: BFF, rate limiting, circuit breaking, request transformation, and API versioning.
0 / 15 completed
1 / 15
An API gateway typically handles which cross-cutting concern?
An API gateway centralises concerns that every service needs: auth token validation, rate limiting, SSL termination, request/response transformation, routing. This avoids duplicating these concerns in every microservice.
2 / 15
Your mobile team wants a BFF (Backend for Frontend). What is this pattern?
BFF creates a separate API gateway for each client type. The mobile BFF returns mobile-optimised payloads; the web BFF returns richer data. This avoids one generic API trying to serve all clients, which leads to over-fetching or under-fetching.
3 / 15
A gateway implements rate limiting of 100 requests per minute. If a client exceeds this, the gateway:
Rate limiting returns HTTP 429 (Too Many Requests) when a client exceeds the configured limit. The response typically includes a Retry-After header. This protects backend services from being overwhelmed by a single client.
4 / 15
The gateway uses a circuit breaker to:
A circuit breaker in the gateway opens when a downstream service's error rate exceeds a threshold — requests immediately fail fast with an error instead of waiting for timeouts. This prevents a single failing service from causing gateway overload.
5 / 15
Fill in the blank: "We route /v1/ to the old backend and /v2/ to the new backend — the gateway handles ___."
API versioning at the gateway lets you run multiple API versions simultaneously — old clients hit /v1/ (routed to the old backend), new clients hit /v2/ (new backend). This enables zero-downtime migrations without forcing all clients to upgrade simultaneously.
6 / 15
Alex (Lead Developer) comments on a PR introducing the GraphQL API Gateway:
'This is great! But I'm seeing a lot of 200 OK responses with empty bodies. It seems like we're not properly validating that the GraphQL query is actually *returning* something useful before forwarding it to the backend services. We need a mechanism to ensure data integrity at the gateway.'
What does Alex mean when he mentions 'validating that the GraphQL query is actually returning something useful'?
Alex is highlighting the importance of data consistency. GraphQL gateways often handle transformations or filtering. Simply forwarding an empty GraphQL response to the backend would lead to errors and wasted processing time. Schema validation at the gateway ensures the expected structure and presence of data are enforced before any further actions.
7 / 15
Maria (API Engineer) sends a Slack message to the team:
'Just deployed the new API Gateway with support for both REST and GraphQL. We're using it to centralize authentication and rate limiting. I've configured it to automatically route requests based on the Content-Type header.'
Maria's statement illustrates a common approach. While utilizing the Content-Type header is a standard technique, it's not the most robust solution for complex API gateways. A more advanced gateway would likely leverage other factors like URL path and HTTP method alongside content type, but this initial configuration demonstrates a foundational understanding of routing based on request headers.
8 / 15
You're reviewing the API Gateway's configuration. It's configured to use a circuit breaker pattern to prevent cascading failures. The gateway has been triggered due to repeated errors from a backend service. What is the *primary* purpose of this circuit breaker?
The circuit breaker pattern is designed to isolate failures. It doesn't simply block traffic; it *temporarily* prevents further requests from reaching a failing backend. This gives the backend time to recover without overwhelming it with continued failed attempts. The gateway monitors the health of the backend and automatically re-establishes connectivity once the backend is operational.
9 / 15
David (DevOps Engineer) writes a comment in the deployment documentation for the GraphQL API Gateway:
'To ensure high availability and resilience, we've implemented an intelligent retry mechanism with exponential backoff. If a backend service returns a 502 error, the gateway will automatically retry the request up to three times before giving up.'
David describes a crucial strategy for improving resilience. The use of exponential backoff combined with retries is a standard technique to handle transient errors – situations where a service might be temporarily unavailable due to network issues or brief overload. This approach helps the gateway gracefully handle these disruptions and maintain API availability.
10 / 15
You are designing an API Gateway for a microservices architecture. Which of the following best describes the role of a GraphQL query in this context?
GraphQL's core strength lies in its ability to precisely request data. By allowing clients to specify exactly what they need, GraphQL avoids the problem of 'over-fetching,' where a full response includes unnecessary fields. This reduces bandwidth usage and improves performance, especially when interacting with multiple backend services – which is precisely what an API gateway facilitates.
11 / 15
Alex (Lead Developer) comments on a PR introducing the GraphQL API Gateway:
'This is great! But I'm seeing a lot of 200 OK responses with empty bodies. It seems like we're not properly validating that the GraphQL query is actually *returning* something useful before forwarding it to the backend services. We need a mechanism to ensure data integrity at the gateway.'
What does Alex mean when he mentions 'validating that the GraphQL query is actually returning something useful'?
Alex is highlighting the importance of data consistency. GraphQL gateways often handle transformations or filtering. Simply forwarding an empty GraphQL response to the backend would lead to errors and wasted processing time. Schema validation at the gateway ensures the expected structure and presence of data are enforced before any further actions.
12 / 15
Maria (API Engineer) sends a Slack message to the team:
'Just deployed the new API Gateway with support for both REST and GraphQL. We're using it to centralize authentication and rate limiting. I've configured it to automatically route requests based on the Content-Type header.'
Maria's statement illustrates a common approach. While utilizing the Content-Type header is a standard technique, it's not the most robust solution for complex API gateways. A more advanced gateway would likely leverage other factors like URL path and HTTP method alongside content type, but this initial configuration demonstrates a foundational understanding of routing based on request headers.
13 / 15
You're reviewing the API Gateway's configuration. It's configured to use a circuit breaker pattern to prevent cascading failures. The gateway has been triggered due to repeated errors from a backend service. What is the *primary* purpose of this circuit breaker?
The circuit breaker pattern is designed to isolate failures. It doesn't simply block traffic; it *temporarily* prevents further requests from reaching a failing backend. This gives the backend time to recover without overwhelming it with continued failed attempts. The gateway monitors the health of the backend and automatically re-establishes connectivity once the backend is operational.
14 / 15
David (DevOps Engineer) writes a comment in the deployment documentation for the GraphQL API Gateway:
'To ensure high availability and resilience, we've implemented an intelligent retry mechanism with exponential backoff. If a backend service returns a 502 error, the gateway will automatically retry the request up to three times before giving up.'
David describes a crucial strategy for improving resilience. The use of exponential backoff combined with retries is a standard technique to handle transient errors – situations where a service might be temporarily unavailable due to network issues or brief overload. This approach helps the gateway gracefully handle these disruptions and maintain API availability.
15 / 15
You are designing an API Gateway for a microservices architecture. Which of the following best describes the role of a GraphQL query in this context?
GraphQL's core strength lies in its ability to precisely request data. By allowing clients to specify exactly what they need, GraphQL avoids the problem of 'over-fetching,' where a full response includes unnecessary fields. This reduces bandwidth usage and improves performance, especially when interacting with multiple backend services – which is precisely what an API gateway facilitates.
What will I practise in "API Gateway Patterns — Vocabulary — GraphQL & API Gateway | CoderLingo"?
Learn API gateway vocabulary: BFF, rate limiting, circuit breaking, request transformation, and API versioning.
How many exercises are in this module?
This module has 15 multiple-choice exercises, each with instant feedback and a full explanation of the correct answer.
Is this exercise free to use?
Yes. Every exercise on CoderSlingo, including this one, is free to use with no account, sign-up, or paywall.
Do I need to create an account to do these exercises?
No account is required. Just click an option to answer — your score for this session is tracked automatically in the progress bar above.
What happens if I choose the wrong answer?
You'll immediately see which answer was correct, plus a full explanation covering the vocabulary and reasoning behind it — mistakes are where most of the learning happens.
Can I retry the exercises if I want a higher score?
Yes — use the "Try again" button on the results screen to reset and go through all the questions again.
Is my progress saved if I close the page?
No. Progress is tracked only for your current visit; reloading or leaving the page resets the counter. This keeps the exercise simple and account-free.
Where can I find more GraphQL & API Gateway Language exercises?
Browse the full GraphQL & API Gateway Language hub for related drills, or check the "Next up" link below to continue with a connected topic.
How is this different from reading an article on the same topic?
Articles explain vocabulary and concepts in prose; this exercise tests and reinforces that vocabulary through active recall with immediate feedback — the two work best together.
Who writes these exercises?
Every exercise is written by the CoderSlingo team, drawing on real workplace English used in IT roles, then reviewed for accuracy and clarity.