Explain a Lambda cold start and how to reduce it.
AWS · Intermediate level
Answer
A Lambda cold start is extra latency when AWS initializes a new execution environment. I reduce it with smaller packages, efficient runtime/init code, client reuse, provisioned concurrency for critical paths, and careful VPC/dependency design.
Technical explanation
Provisioned concurrency reduces cold starts for latency-sensitive APIs but adds cost.
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
- How do you trigger a Lambda function - name several event sources.
- What is ElastiCache, and what is the difference between Redis and Memcached on it?
- Explain DynamoDB partition keys, sort keys, and the importance of access patterns.
- What is Amazon EKS, and what does AWS manage versus what you manage?
- What is Amazon Aurora, and how does it differ from standard RDS?
- What are managed node groups versus self-managed nodes versus Fargate on EKS?
- What is Multi-AZ in RDS, and how does failover work?
- How does the AWS VPC CNI assign pod networking on EKS?