Microservices API Gateway and Management 3 — Questions and Answers
Question 1: Which task is typically NOT a responsibility of an API gateway?
- Implementing core business logic of a service (Correct answer)
- Authentication
- Rate limiting
- Request routing
Correct answer: Implementing core business logic of a service
Business logic belongs in the microservices themselves; the gateway handles cross-cutting concerns like auth and routing.
Question 2: What does API versioning via the URL path look like?
- /v1/orders and /v2/orders (Correct answer)
- ?token=abc
- Accept-Encoding: gzip
- X-Request-ID header
Correct answer: /v1/orders and /v2/orders
Path-based versioning embeds the version directly in the URL, e.g. /v1/ and /v2/, letting clients pick a version explicitly.
Question 3: In service mesh terminology, what handles east-west (service-to-service) traffic while a gateway handles north-south traffic?
- Sidecar proxies (Correct answer)
- DNS servers
- Load balancers only
- CDN edge nodes
Correct answer: Sidecar proxies
Service meshes use sidecar proxies for internal east-west traffic, whereas the gateway manages external north-south traffic.
Question 4: What is the benefit of response caching at the gateway?
- Reduced load on backend services and lower latency for repeated requests (Correct answer)
- Guaranteed strong consistency
- Automatic database sharding
- Elimination of authentication
Correct answer: Reduced load on backend services and lower latency for repeated requests
Caching common responses at the gateway serves repeated requests quickly without hitting backend services.
Question 5: Which header is commonly injected by a gateway to enable distributed tracing across services?
- A correlation/trace ID header (Correct answer)
- Content-Length
- Host
- User-Agent
Correct answer: A correlation/trace ID header
Gateways add a correlation or trace ID so a request can be followed across multiple microservices in tracing tools.
Question 6: What is the purpose of request/response transformation at the gateway?
- Adapting payload formats or protocols between clients and services (Correct answer)
- Storing user passwords
- Compiling source code
- Provisioning servers
Correct answer: Adapting payload formats or protocols between clients and services
Transformation lets the gateway reshape payloads or translate protocols (e.g., REST to gRPC) so clients and services need not match exactly.
Question 7: Which approach helps a gateway find healthy service instances dynamically as they scale?
- Service discovery via a registry (Correct answer)
- Hardcoding IP addresses
- Manual DNS edits per deploy
- Disabling health checks
Correct answer: Service discovery via a registry
Service discovery uses a registry so the gateway can route to current healthy instances without hardcoded addresses.
Which task is typically NOT a responsibility of an API gateway?