What is API Gateway, and how does it integrate with Lambda?
AWS · Intermediate level
Answer
API Gateway is a managed API front door for exposing, securing, throttling, and routing APIs. With Lambda integration, it handles the HTTP request path and invokes Lambda as the backend, with authorization, logging, and throttling controls.
Technical explanation
API Gateway throttling and authorization protect Lambda and downstream systems before code execution.
Serverless design shifts server operations to AWS but increases the importance of event semantics, timeouts, retries, idempotency, concurrency, and downstream protection.
Observability must include structured logs, metrics, traces, DLQs or failure destinations, and alarms on errors, throttles, duration, and age/lag where applicable.
Cold starts, package size, runtime choice, and VPC dependencies should be measured against p95/p99 latency rather than assumed.
Hands-on example
1. Build a small event-driven flow using Lambda plus the relevant event source such as API Gateway, S3, SQS, or EventBridge.
2. Configure timeout, memory, reserved concurrency, IAM role, structured logs, metrics, tracing, and DLQ or failure destination.
3. Inject duplicate events, timeouts, and downstream failures to validate retries and idempotency.
4. Create alarms for errors, throttles, duration, iterator age or queue age, and DLQ messages.
Check how well your resume matches the role with our free resume checker— match score, ATS check, and the skills you're missing.
More AWS interview questions
- What is the AWS shared responsibility model, and where is the line between AWS and the customer?
- Explain the difference between a Region, an Availability Zone, and an Edge Location.
- What is a VPC, and what are its core components (subnets, route tables, IGW, NAT)?
- Difference between a public and a private subnet, and how does each reach the internet?
- What is the difference between a Security Group and a Network ACL?
- Are Security Groups stateful or stateless? What about NACLs?
- What is an Internet Gateway versus a NAT Gateway, and when do you need each?
- How does a NAT Gateway differ from a NAT instance?