AWS Serverless Computing 4 — Questions and Answers
Question 1: Which AWS Lambda feature allows you to run a function for up to 15 minutes without a cold start penalty on subsequent invocations?
- Provisioned Concurrency (Correct answer)
- Reserved Concurrency
- Lambda Layers
- Lambda Extensions
Correct answer: Provisioned Concurrency
Provisioned Concurrency keeps Lambda execution environments initialized and ready, eliminating cold starts for latency-sensitive applications.
Question 2: An AWS Lambda function needs to access a secret stored in AWS Secrets Manager without hardcoding credentials. What is the recommended approach?
- Store credentials in environment variables
- Attach an IAM role with GetSecretValue permission to the Lambda function (Correct answer)
- Use a Lambda Layer to bundle the credentials
- Embed credentials in the deployment package
Correct answer: Attach an IAM role with GetSecretValue permission to the Lambda function
Attaching an IAM execution role with Secrets Manager permissions is the secure, recommended way to grant Lambda access to secrets.
Question 3: What happens to an AWS Lambda function's environment variables when you publish a new version?
- Environment variables are not included in versions
- Environment variables are snapshot into the published version and cannot be changed (Correct answer)
- Environment variables are inherited from $LATEST at invocation time
- Environment variables must be re-specified manually each time
Correct answer: Environment variables are snapshot into the published version and cannot be changed
When you publish a Lambda version, the configuration including environment variables is frozen and immutable for that version.
Question 4: Which EventBridge (CloudWatch Events) feature enables you to send events from an AWS Lambda function to multiple downstream targets simultaneously?
- Event buses with multiple rules (Correct answer)
- Lambda Destinations
- SQS fan-out
- SNS FIFO topics
Correct answer: Event buses with multiple rules
EventBridge rules on an event bus can match a single event and route it to multiple targets concurrently, enabling fan-out patterns.
Question 5: A Step Functions state machine needs to wait for a human approval before proceeding. Which integration pattern should be used?
- Request-Response
- Sync (.sync:2)
- Wait for Task Token (.waitForTaskToken) (Correct answer)
- Express Workflow callback
Correct answer: Wait for Task Token (.waitForTaskToken)
The waitForTaskToken pattern pauses execution until an external process calls SendTaskSuccess or SendTaskFailure with the provided token.
Question 6: What is the maximum size of a Lambda deployment package (unzipped) when deploying directly without a container image?
- 50 MB
- 250 MB (Correct answer)
- 500 MB
- 1 GB
Correct answer: 250 MB
Lambda supports unzipped deployment packages up to 250 MB; the zipped package uploaded directly is limited to 50 MB.
Question 7: Which AWS service provides a fully managed GraphQL API layer that integrates natively with Lambda, DynamoDB, and other AWS data sources?
- API Gateway REST API
- AWS AppSync (Correct answer)
- AWS Amplify API
- Amazon Cognito
Correct answer: AWS AppSync
AWS AppSync is the managed GraphQL service that connects to Lambda resolvers, DynamoDB, RDS, and HTTP endpoints out of the box.
Which AWS Lambda feature allows you to run a function for up to 15 minutes without a cold start penalty on subsequent invocations?