7 questions foundWhat is AWS Lambda and how does the serverless computing model differ from traditional server based applications?
Beginner AWS Lambda lets you run code without provisioning or managing any servers at all, automatically scaling from handling a single request to thousands of concurrent requests and back down again, charging you only for the exact compute time your code actually consumes, which contrasts sharply with traditional server based applications where you must provision, patch, and pay for server capacity whether or not it is actively being used.
aws lambda create-function --function-name my-function --runtime python3.12 --role arn:aws:iam::123456789012:role/lambda-role --handler app.handler --zip-file fileb://function.zip
Real-world example A company processes uploaded images using a Lambda function that only runs, and only incurs cost, at the exact moment a new image is uploaded, rather than paying for a continuously running server sitting idle between uploads.
Common follow-ups: What programming languages does Lambda support?;What is the maximum execution time allowed for a single Lambda function invocation?
Amazon API Gateway;Amazon S3 & Storage
What event sources can trigger a Lambda function to execute, and how does this support building event driven applications?
Beginner Lambda functions can be triggered by a wide variety of event sources, including an S3 object upload, a new message arriving in an SQS queue, an API Gateway request, a scheduled EventBridge rule, or a change captured in a DynamoDB stream, letting you build applications that react automatically to events as they occur throughout your AWS environment rather than needing a continuously running process to poll for changes.
aws lambda create-event-source-mapping --function-name process-orders --event-source-arn arn:aws:sqs:us-east-1:123456789012:orders-queue
Real-world example An order processing system triggers a Lambda function automatically whenever a new message arrives in an SQS queue, processing each order the moment it is ready rather than running a continuously active server that repeatedly checks the queue for new work.
Common follow-ups: Can a single Lambda function be triggered by multiple different event sources simultaneously?;How does Lambda handle a sudden burst of many events arriving at once?
Amazon SQS (Simple Queue Service);Amazon EventBridge
What is a cold start in Lambda, and what strategies help reduce its impact on application performance?
Intermediate A cold start occurs when Lambda needs to initialize a brand new execution environment for a function that has not run recently, adding some additional latency compared to a warm invocation that reuses an already initialized environment, and strategies to reduce cold start impact include choosing a lighter weight runtime, minimizing the size of your deployment package and its dependencies, and using Provisioned Concurrency to keep a specified number of execution environments pre initialized and ready to respond immediately.
aws lambda put-provisioned-concurrency-config --function-name my-function --qualifier prod --provisioned-concurrent-executions 5
Real-world example A customer facing API backed by Lambda enables Provisioned Concurrency to keep several execution environments warm at all times, ensuring consistent low latency responses for users even during periods of low traffic when a cold start would otherwise be more likely.
Common follow-ups: How much additional latency does a typical cold start actually add?;What is the cost tradeoff of enabling Provisioned Concurrency compared to accepting occasional cold starts?
Auto Scaling Groups;Amazon API Gateway
How does Lambda concurrency work, and what is the difference between reserved concurrency and the account level concurrency limit?
Intermediate Lambda's concurrency represents the number of simultaneous executions of your function that can run at any given moment, with every AWS account having an overall regional concurrency limit shared across all functions, and reserved concurrency lets you guarantee a specific portion of that overall limit exclusively for a particular function, both protecting that function from being starved of capacity by other functions and also capping how much that specific function can scale, which can be useful to prevent it from overwhelming a downstream resource like a database.
aws lambda put-function-concurrency --function-name critical-function --reserved-concurrent-executions 50
Real-world example A company reserves fifty concurrent executions specifically for its critical payment processing Lambda function, ensuring it always has guaranteed capacity available even if other, less critical functions in the same account experience an unexpected traffic spike.
Common follow-ups: What happens to a Lambda invocation if the concurrency limit is reached?;How do you request an increase to your account's overall Lambda concurrency limit?
RDS & Databases;Auto Scaling Groups
How do Lambda layers help share common code and dependencies across multiple functions without duplicating that code in every deployment package?
Intermediate A Lambda layer is a separate archive containing libraries, custom runtimes, or other dependencies that can be attached to multiple Lambda functions, meaning shared code, such as a common logging library or a large third party dependency, only needs to be packaged and updated in one place, keeping individual function deployment packages smaller and making it easier to maintain consistency across many related functions.
aws lambda publish-layer-version --layer-name common-utilities --zip-file fileb://layer.zip
Real-world example A company with dozens of Lambda functions extracts their shared logging and error handling code into a single Lambda layer, attaching it to every function so that a bug fix in that shared logic only needs to be updated and republished once rather than in every individual function's deployment package.
Common follow-ups: How many layers can a single Lambda function use at once?;What is the maximum combined size limit when using layers alongside a function's own code?
AWS Serverless Application Model (SAM);IaC (CloudFormation)
How does Lambda support running functions within a VPC, and what performance considerations does this introduce compared to functions that do not need VPC access?
Advanced Lambda functions can be configured to run within a specific VPC, which is necessary when the function needs to access resources like an RDS database or ElastiCache cluster that are not publicly accessible, and while modern Lambda VPC networking has significantly improved cold start performance compared to older implementations, functions still need properly configured subnets with sufficient available IP addresses and appropriate route tables if they also need outbound internet access through a NAT Gateway.
aws lambda update-function-configuration --function-name my-function --vpc-config SubnetIds=subnet-12345,SecurityGroupIds=sg-12345
Real-world example A Lambda function needing to query a private RDS database is configured to run within the same VPC as that database, using a properly sized subnet to avoid IP address exhaustion issues during periods of high concurrent execution.
Common follow-ups: How do you provide internet access to a Lambda function running inside a private VPC subnet?;What IP address exhaustion issues can occur with VPC connected Lambda functions at high concurrency?
VPC & Networking;RDS & Databases
How should an organization approach designing observability and error handling for a complex, multi function serverless architecture built on Lambda?
Advanced Effective observability for a complex serverless architecture typically involves using AWS X-Ray for distributed tracing to visualize how a single request flows through multiple Lambda functions and other services, implementing structured logging with correlation identifiers that let you trace a specific request across CloudWatch Logs from multiple functions, configuring dead letter queues or on failure destinations to capture and investigate failed asynchronous invocations, and setting up CloudWatch alarms on key metrics like error rates and duration to catch issues proactively rather than only discovering them through customer complaints.
aws lambda put-function-event-invoke-config --function-name my-function --destination-config '{"OnFailure":{"Destination":"arn:aws:sqs:us-east-1:123456789012:failed-invocations"}}'
Real-world example A company running a complex serverless order processing pipeline spanning a dozen Lambda functions implements X-Ray tracing and structured logging with correlation IDs, allowing their team to quickly trace exactly which function in the chain failed when a customer reports a missing order, rather than manually searching through a dozen separate log groups.
Common follow-ups: How does AWS X-Ray trace a request across multiple independent Lambda functions?;What is the difference between a dead letter queue and an on failure destination for asynchronous Lambda invocations?
Monitoring (CloudWatch);Amazon SQS (Simple Queue Service)