Lesson 11 of 30
This track's compute lesson covers what runs behind an API — Lambda, EC2, Fargate. API Gateway is the front door in front of all of them: the thing a client actually talks to, and the thing that decides whether a request even reaches the backend at all.
12 min read
Every option explains itself — why the right one is right, and why each wrong one is wrong. Miss one and it comes back later on a spaced-repetition schedule.
Question 1 of 3
A caller's requests exceed their usage plan's rate limit. What happens to the request?
Hints without spoilers, and a plain explanation of why a wrong answer was wrong — answered only from this lesson. Free account, no card.
Sign up freeWhat interviewers actually ask about this, and what a strong answer has to cover.
A strong answer covers
Likely follow-ups
API Gateway sits between a client and a backend, doing the job a hand-rolled router-plus-reverse-proxy would otherwise do: it takes an incoming HTTP request, decides which backend it maps to, and forwards it — while handling the cross-cutting concerns that shouldn't have to live inside every individual backend function.
Two product lines exist within API Gateway, and the choice between them is a real tradeoff, not "old vs. new done right":
Whichever type is used, the core jobs are the same: routing (map a path and method to a specific backend integration), throttling (rate-limit requests before they ever reach the backend), authorization (decide whether this caller is allowed to hit this route at all), and usage plans (tie an API key to a specific quota/rate tier — a free tier versus a paid tier, for example).
A client sends POST /orders to API Gateway — not directly to Lambda.
A client sends POST /orders. API Gateway checks the caller's API key against its usage plan's rate limit. Under the limit: the request passes through a Lambda proxy integration, which invokes the order-creation Lambda function with the full raw request, and API Gateway reshapes whatever the function returns into the HTTP response sent back to the client. Over the limit: API Gateway returns a 429 immediately — the Lambda function is never invoked at all.
"What's actually different about putting API Gateway in front of a Lambda function versus giving a client a way to call it directly?" tests whether a candidate can name concrete value beyond "it makes Lambda reachable over HTTP" — throttling that protects concurrency, authorization before the function ever runs, and usage plans that meter callers, all of which a bare, unprotected endpoint doesn't get for free.