Skip to content

Top 30 API Gateway Interview Questions and Answers [2026]

September 28, 2026 15 min read
API Gateway interview guide by Second Talent
TL;DR: API gateway interviews in 2026 test routing, auth at the edge, rate limiting, resilience patterns, and for AWS roles, the trade-offs between REST APIs and HTTP APIs. Candidates should know that Kubernetes retired Ingress NGINX in March 2026, and that Gateway API is now the standard way to configure a gateway on Kubernetes.

The Kubernetes project ended maintenance of Ingress NGINX in March 2026 and archived its repository. Its last releases shipped on March 19, 2026, and the project named Gateway API as the replacement.

Every cluster still running it has to move its edge routing to something else. Senior candidates are expected to reason about routing, auth, rate limits and failure handling, on Kubernetes and on AWS.

Key takeaways
  1. 1Current releases as of September 2026: Gateway API v1.6.2 and Envoy Gateway v1.9.1.
  2. 2AWS API Gateway's default account quota is 10,000 requests per second with a 5,000-request burst, per Region, shared by all your APIs.
  3. 3Since November 2025, AWS REST APIs can stream responses for up to 15 minutes and send payloads larger than 10 MB.
  4. 4The IETF RateLimit header fields are still a draft (revision 11), so most gateways still signal limits with 429 and Retry-After.

Core Concepts

1. What does an API gateway do?

An API gateway is the single entry point that routes client requests to backend services and applies shared rules on the way in. Those rules usually cover authentication, rate limiting, TLS, logging and request shaping.

The benefit is that each service stops doing this work on its own. Clients also see one stable host, even as services behind it split, merge or move. The cost is one more hop, and one more component that must be highly available.

A gateway should run as several stateless instances across zones, with shared state such as rate-limit counters kept in an external store.

2. How is a gateway different from a reverse proxy or a load balancer?

A load balancer spreads traffic across identical instances. A reverse proxy forwards HTTP requests by host or path.

An API gateway is a reverse proxy that also understands API concerns: who the caller is, which plan they are on, and what limits apply.

  • Load balancer: Layer 4 (TCP) or Layer 7 (HTTP). Health checks and spreading load.
  • Reverse proxy: Layer 7 routing, TLS termination, compression.
  • API gateway: all of that, plus API keys, token checks, quotas, transformations and developer onboarding.

The lines blur in practice. Envoy, NGINX and HAProxy can each play all three roles, depending on configuration.

3. What is the difference between an API gateway and a service mesh?

A gateway handles north-south traffic, from outside clients into the system. A service mesh handles east-west traffic, between services inside it.

The gateway deals with public concerns: external auth, API keys, quotas and a stable public contract. The mesh deals with internal ones: mTLS between every pair of services, retries and traffic splits on internal calls.

Many systems run both. Gateway API has covered mesh routing in its Standard channel since v1.1, so one set of route resources can now describe both kinds of traffic.

4. What is the backend-for-frontend pattern?

A backend for frontend (BFF) is a separate gateway layer for each client type, such as one for the web app and one for the mobile app. Each BFF shapes and combines responses for its own client.

A mobile screen that needs data from four services can make one call to its BFF, which fans out to the four and returns a small response. The pattern is described by Sam Newman.

The usual rule is that the team that owns the client also owns its BFF, so the two change together.

5. How does a gateway help migrate a monolith?

It lets you move one route at a time from the monolith to new services, with no change for clients. This is the strangler fig approach.

At first, every route points at the monolith. When a new orders service is ready, you change only the /orders route. Weighted routing can shift 5% of traffic first and roll back in seconds if error rates rise.

When no routes point at the monolith, you can switch it off.

6. What should not go into an API gateway?

Business logic. A gateway that checks order totals or joins data from five services becomes a shared monolith that every team must change and redeploy.

Keep the gateway to cross-cutting rules that are the same for many services: auth, limits, routing, headers. Response aggregation for one client belongs in a BFF owned by that client's team.

Per-object permission checks belong in the service that owns the data.

Security at the Edge

7. How should a gateway validate JWT access tokens?

It should check the signature against the issuer's published keys, then check the issuer, audience and expiry, before any request reaches a service.

The gateway fetches the issuer's JWKS and caches it. It must pin the allowed algorithms in config, not read them from the token. After validation, it can pass the user ID and scopes to the service in headers.

The service can then trust those headers, but only if it cannot be reached except through the gateway.

8. Can a gateway prevent broken object level authorization (BOLA)?

Only partly. A gateway can check that a token has the right scope for GET /invoices/{id}, but it usually cannot tell whether invoice 812 belongs to that user. That needs the service's own data.

So the gateway does coarse checks, such as scopes, roles and tenants. The service does object-level checks.

BOLA has been number one on the OWASP API Security Top 10 in both the 2019 and 2023 editions, and a design that relies on the gateway alone is a common cause.

9. A gateway adds an X-User-Id header after auth. What can go wrong?

If the gateway forwards a client's own X-User-Id header unchanged, any caller can claim to be any user. The gateway must strip incoming copies of every identity header before it sets its own.

The second risk is a service that can also be reached directly, not through the gateway. Then anyone who finds its address can send the header. Network rules, private subnets or mTLS between gateway and service close that path.

10. Where does mTLS fit in a gateway design?

mTLS can secure both sides of the gateway. On the client side, the gateway asks callers for a certificate, which suits B2B partners and devices.

On the backend side, the gateway presents its own certificate, so a service can refuse any caller that is not the gateway.

Gateway API made client certificate validation part of its Standard channel in v1.5. AWS added backend mTLS with certificates from ACM in September 2026, covered below.

11. How does a WAF relate to an API gateway?

A WAF inspects requests for attack patterns, such as SQL injection, known bad bots and oversized bodies, usually before the gateway sees them. The gateway then applies identity-based rules that a WAF cannot, such as per-key quotas.

On AWS, WAF attaches directly to REST APIs but not to HTTP APIs. That difference alone often decides which API type a team picks.

Traffic and Resilience

12. Compare the common rate limiting algorithms.

Token bucket is the usual default because it allows short bursts while holding the average rate. The four common options:

  • Token bucket: tokens refill at a fixed rate; each request spends one. Bursts are allowed up to the bucket size. AWS API Gateway uses this.
  • Leaky bucket: requests drain from a queue at a fixed rate, which smooths traffic but adds delay.
  • Fixed window: a counter per minute. Simple, but a client can send twice the limit around a window boundary.
  • Sliding window: weights the previous window's count to remove that boundary spike, at the cost of a little more state.

13. How do you rate limit across many gateway instances?

Use a shared counter, usually in Redis or a dedicated rate-limit service, so ten gateway instances enforce one limit rather than ten.

A pure local limit is faster, but each instance only sees its share of traffic. Many teams combine both: a loose local limit to absorb spikes cheaply, and a global limit for the real quota.

When a client is over the limit, the gateway returns 429 Too Many Requests, defined in RFC 6585, with a Retry-After header. The standard RateLimit header fields that tell clients their remaining quota are still an IETF draft.

14. Explain the circuit breaker pattern at the gateway.

A circuit breaker stops sending requests to a backend that keeps failing, so the backend can recover and clients fail fast. It has three states.

Cycle of circuit breaker states: closed lets requests flow and counts failures, open rejects calls at once after too many failures, half-open lets a few trial calls through after a cool-down and closes again on success.

In closed, requests flow and failures are counted. Past a threshold, it trips to open and rejects calls at once, often with a 503 or a fallback. After a cool-down it goes half-open and lets a few trial requests through.

Success closes it; failure opens it again. Martin Fowler's circuit breaker article is the usual reference. In Envoy-based gateways, outlier detection does a similar job per host by ejecting a failing instance from the pool.

15. How should a gateway handle retries and timeouts?

Retry only idempotent requests, with backoff and a cap, and set a timeout on every route. Retrying a POST that timed out can charge a card twice unless the API takes an idempotency key.

Retries also multiply load. Three layers that each retry three times turn one failing call into 27. Limit retries to one layer, usually the gateway or the client.

A retry budget, which caps retries as a share of normal traffic, stops a retry storm during an outage. The gateway's timeout should also be shorter than the client's, so the client gets a clear error rather than a dropped connection.

16. How does a gateway support canary releases?

It splits traffic between two versions of a service by weight or by a rule, such as a header or a user group. You send 1% to the new version, watch error rate and latency, then raise the weight in steps.

In Gateway API, this is a single HTTPRoute with two backendRefs and weights:

apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: orders
spec:
  parentRefs:
  - name: public-gateway
  rules:
  - matches:
    - path: { type: PathPrefix, value: /orders }
    backendRefs:
    - name: orders-v1
      port: 8080
      weight: 95
    - name: orders-v2
      port: 8080
      weight: 5

17. How does response caching at the gateway work, and what can go wrong?

The gateway stores responses under a cache key, usually the method, path and chosen query parameters, and serves repeats until a TTL expires. It suits public, read-heavy data such as product lists.

The classic bug is a cache key that leaves out who the caller is. Then one user's private response is served to the next user. Keep the Authorization header or tenant ID in the key for anything user-specific, or do not cache it.

On AWS, caching is available for REST APIs only.

18. How does distributed tracing pass through a gateway?

The gateway reads the W3C traceparent header if the client sent one, or starts a new trace if not. It then forwards the header to the backend, so every service adds its spans to the same trace.

The gateway's own span shows time spent in auth, rate limiting and waiting on the backend. That makes it the first place to look when a request is slow.

Many teams also return the trace ID in a response header, so a support ticket can point straight to the trace.

AWS API Gateway

19. When do you choose a REST API over an HTTP API in AWS API Gateway?

Choose a REST API when you need its extra features, and an HTTP API when you do not and want the lower price. AWS's own comparison lists what only REST APIs have.

Grid comparing AWS API Gateway REST APIs and HTTP APIs: only REST APIs have API keys and usage plans, per-client throttling, request validation, AWS WAF, caching, private endpoints and response streaming; only HTTP APIs have a built-in JWT authorizer and automatic deployments.

REST-only features include API keys, per-client throttling, request validation, AWS WAF, caching, private endpoints and response streaming. HTTP APIs have a built-in JWT authorizer and automatic deployments.

They can also reach private backends through AWS Cloud Map. WebSocket APIs are a third type, for two-way connections.

20. What is the difference between Lambda proxy and non-proxy integration?

With proxy integration, API Gateway passes the whole request to Lambda as one event and expects a set response shape back. With non-proxy integration, you write mapping templates to reshape the request and response.

In proxy mode, the function must return an object with statusCode, headers, body and isBase64Encoded. A plain string causes a 502. Most new APIs use proxy mode because the routing logic lives in code and is easier to test.

Non-proxy mode still suits direct calls to other AWS services without a Lambda in between.

export const handler = async (event) => ({
  statusCode: 200,
  headers: { "content-type": "application/json" },
  body: JSON.stringify({ id: event.pathParameters.id }),
});

21. How does throttling work in AWS API Gateway?

API Gateway throttles with a token bucket at several levels, and the tightest one wins. According to the throttling docs, it applies them in this order:

  1. Per-client or per-method limits set in a usage plan, tied to API keys.
  2. Per-method limits set on a stage.
  3. The account limit per Region: by default 10,000 requests per second with a 5,000-request burst.
  4. AWS's own Regional limit.
Smaller Regions start lower. AWS lists a default of 2,500 requests per second with a 1,250 burst in some newer Regions, such as Africa (Cape Town), Europe (Milan) and Asia Pacific (Jakarta). Check the quota for the Region you deploy to.

Two details catch people out. The account limit is shared by every API in that Region, so one noisy API can throttle the rest.

And AWS calls these limits "targets rather than guaranteed request ceilings", so usage plans are not a billing-grade meter.

22. Which authorizers does API Gateway support?

REST APIs support IAM, Amazon Cognito user pools and Lambda authorizers. HTTP APIs support IAM, Lambda authorizers and a built-in JWT authorizer.

  • IAM: callers sign requests with SigV4. Best for service-to-service calls inside AWS.
  • Cognito or JWT authorizer: validates tokens from a user pool or any OIDC issuer with no code.
  • Lambda authorizer: your code returns an IAM policy. Use it for API keys from another system or custom rules.

Lambda authorizers can cache their policy for a TTL you set, keyed on the token or on chosen request values. With caching on, the policy must cover every method the caller may hit.

A policy that allows only the first method called will wrongly deny the others until the cache expires.

23. What are stages and stage variables?

A stage is a named deployment of an API, such as dev or prod, with its own URL, settings, logs and throttling.

Stage variables are key-value pairs per stage that the API can read, for example to point prod at one Lambda alias and dev at another.

REST API stages also support canary settings, which send a set share of traffic to a new deployment before you promote it.

24. What limits shape API Gateway designs?

Three limits come up most often, all from the quotas page:

  • Payload size: 10 MB for REST and HTTP APIs. Larger files usually go straight to S3 with a pre-signed URL.
  • Integration timeout: 29 seconds by default for REST APIs. Regional and private REST APIs can now raise it; edge-optimized ones cannot. HTTP APIs max out at 30 seconds.
  • Header size: 20,480 bytes in total for most REST APIs, and 8,000 bytes for private APIs.

Long-running work should not hold a request open. The usual design returns 202 Accepted with a job ID, runs the work in a queue or Step Functions, and lets the client poll or receive a callback.

What Changed Recently

May 9, 2024
Gateway API v1.1: GRPCRoute and mesh support reach GA
Jun 4, 2024
AWS: REST API integration timeout can go past 29 seconds
Jun 3, 2025
AWS: routing rules for REST API custom domains
Nov 11, 2025
Kubernetes announces the Ingress NGINX retirement
Nov 19, 2025
AWS: response streaming for REST APIs
Feb 27, 2026
Gateway API v1.5: ListenerSet, CORS filter and TLSRoute reach GA
Sep 8, 2026
AWS: mutual TLS for backend integrations

25. Why are teams moving from Ingress NGINX to Gateway API?

Because Ingress NGINX is retired. The Kubernetes announcement of November 11, 2025 set best-effort maintenance until March 2026.

After that there are "no further releases, no bugfixes, and no updates to resolve any security vulnerabilities". Existing installs keep running, but they will not get security fixes.

The announcement recommends Gateway API as "the modern replacement for Ingress". It also splits roles that Ingress mixed together. A platform team owns the Gateway, with its listeners and certificates.

App teams own HTTPRoute objects in their own namespaces. The annotations each controller invented for Ingress become typed fields, such as weights, header matches and timeouts.

Ingress
  • One object mixes infrastructure and routes
  • Weights, rewrites and timeouts live in controller-specific annotations
  • HTTP and HTTPS only
Gateway API
  • GatewayClass, Gateway and routes owned by different roles
  • Weights, header matches and timeouts are typed fields
  • HTTP, gRPC, TLS, TCP and UDP routes

26. What reached GA in Gateway API between v1.1 and v1.6?

Most of what teams used to need annotations for. The release notes show this path into the Standard channel:

  • v1.1 (May 2024): GRPCRoute and service mesh support.
  • v1.4 (October 2025): BackendTLSPolicy, for TLS from the gateway to backends.
  • v1.5 (February 2026): ListenerSet, the HTTPRoute CORS filter, TLSRoute v1 and client certificate validation. It also added an admission policy that blocks unsafe CRD downgrades (v1.5.0 notes).
  • v1.6 (June 2026): TCPRoute and UDPRoute graduated to v1 (v1.6.0 notes).

A strong candidate also knows the two channels. Standard holds stable APIs. Experimental holds features that may still change, and v1.5 blocks installing Experimental CRDs over Standard ones.

27. How did AWS change API Gateway timeouts for long responses?

In two steps. In June 2024, AWS let Regional and private REST APIs raise the integration timeout past 29 seconds. The trade-off is that this "might require a reduction in your account-level throttle quota".

In November 2025, it added response streaming for REST APIs. Streaming sends bytes to the client as the backend produces them.

It allows integration timeouts up to 15 minutes and payloads over 10 MB, and it works with Lambda, HTTP proxy and private integrations. AWS pitched both changes at LLM workloads, where a full answer can take longer than 29 seconds.

28. What are routing rules for REST API custom domains?

Routing rules let one custom domain send a request to different REST APIs or stages based on HTTP headers, the base path, or both. AWS added them in June 2025.

Rules run in priority order, lowest number first, and the first rule whose conditions all match wins. Typical uses are header-based API versioning, such as Api-Version: 2, and A/B tests, without a proxy layer in front of API Gateway.

29. What does backend mTLS in API Gateway add?

Since September 8, 2026, a REST API can present a certificate from AWS Certificate Manager to its backend during the TLS handshake. Before that, API Gateway could only present a self-signed certificate that it generated.

The backend can now check that the caller is the gateway, using a CA it already trusts. ACM renewals reach API Gateway without a redeploy. Combined with inbound mTLS for clients, both hops of a request can be mutually authenticated.

30. How are gateways being used for AI agent traffic?

Gateways now translate existing APIs into tools that AI agents can call. In December 2025, AWS added an MCP proxy that exposes REST APIs as Model Context Protocol endpoints through Amazon Bedrock AgentCore Gateway.

For an interview, the design questions matter more than the product. Which identity does the agent use? Which scopes should an agent token get? How do you rate limit a client that can call hundreds of tools in a loop?

The same gateway controls apply: narrow scopes, per-client quotas and full request logs.

Signs of a Strong Answer

  • They keep business logic out of the gateway and can say where aggregation and object-level checks belong instead.
  • They strip client-supplied identity headers and make sure services cannot be reached around the gateway.
  • They limit retries to idempotent calls in one layer and mention a retry budget or idempotency keys.
  • On AWS, they pick REST or HTTP APIs from a specific feature (WAF, usage plans, JWT authorizer), not from habit.
  • They know the account throttle is shared across all APIs in a Region and plan per-client limits under it.
  • They have a plan, or a finished migration, from Ingress NGINX to Gateway API, and can name the controller they chose.

Hiring API and Platform Engineers

Gateway work sits between platform and back-end teams, so it needs engineers who understand both networking and APIs.

Second Talent matches companies with pre-vetted API developers and DevOps engineers from Asia, screened with questions like these.

Tell us the stack and we send a shortlist within 24 hours. Start hiring, or see our JWT and API security interview guides.

Ready to hire? Hire API Developers: vetted AI-native talent, with first profiles in 24 hours.

Get developers who ship with AI agents.

Starts at $23/Hour.

Start Hiring

$0 cost until you hire