Validation Quiz - MODULE 11
This 30-question quiz allows you to validate your knowledge of AWS Lambda before moving on to the practical lab.
Question 1
What is AWS Lambda?
A) A type of EC2 instance
B) A serverless compute service that runs code without managing servers
C) A database service
D) A Load Balancer
See the answer
Answer: B
AWS Lambda is a serverless compute service that runs your code in response to events. You manage no servers: no provisioning, no maintenance, no manual scaling. You only pay for the execution time.
Question 2
What does "serverless" mean?
A) No servers at all
B) You don't have to manage the servers - AWS takes care of it
C) Free servers
D) Virtual servers
See the answer
Answer: B
Serverless doesn't mean there are no servers, but that you don't have to manage them. AWS provisions, maintains, and scales the infrastructure automatically. You focus only on your code.
Question 3
How is Lambda billed?
A) By the hour
B) By the number of requests and execution time (GB-seconds)
C) Monthly flat rate
D) By the number of functions
See the answer
Answer: B
Lambda bills based on: the number of invocations (first 1M/month free), and the execution duration measured in GB-seconds (allocated memory x time). No charges when the code is not running.
Question 4
What is the maximum execution time for a Lambda function?
A) 5 minutes
B) 15 minutes
C) 1 hour
D) Unlimited
See the answer
Answer: B
The maximum timeout for a Lambda function is 15 minutes (900 seconds). If your processing exceeds this time, consider splitting it into multiple functions, using Step Functions, or migrating to EC2/ECS.
Question 5
Which programming languages does Lambda natively support?
A) Only Python
B) Python, Node.js, Java, Go, .NET, Ruby
C) Only Java
D) Only JavaScript
See the answer
Answer: B
Lambda natively supports: Python, Node.js, Java, Go, .NET (C#, PowerShell), Ruby. You can also use custom runtimes for other languages via Lambda Layers or containers.
Question 6
What is an "event" in Lambda?
A) A calendar event
B) The JSON data passed to the function upon invocation
C) A log
D) An error
See the answer
Answer: B
The event is a JSON document containing the data triggering the execution. Its structure depends on the source (S3, API Gateway, SQS, etc.). The function receives this event and the execution context.
Question 7
What is a Lambda "trigger"?
A) A physical trigger
B) An event source that automatically invokes the function
C) A start button
D) A type of error
See the answer
Answer: B
A trigger is an AWS service configured to automatically invoke your Lambda function. Examples: S3 (new file), API Gateway (HTTP request), CloudWatch Events (cron), DynamoDB Streams, SQS, SNS, etc.
Question 8
Which AWS services can trigger Lambda?
A) Only S3
B) S3, API Gateway, DynamoDB, SQS, SNS, CloudWatch, Kinesis, and more
C) Only API Gateway
D) Only CloudWatch
See the answer
Answer: B
Many services can trigger Lambda: S3 (object events), API Gateway (HTTP), DynamoDB Streams, SQS, SNS, CloudWatch Events/Logs, Kinesis, Cognito, IoT, Step Functions, etc. It's the essence of event-driven architecture.
Question 9
What is the "handler" in a Lambda function?
A) An error handler
B) The entry point of the function, the method called upon invocation
C) A type of trigger
D) A configuration file
See the answer
Answer: B
The handler is the entry point of your function. It's the method that Lambda calls when the function is invoked. Format: file.method (e.g., index.handler in Node.js, lambda_function.lambda_handler in Python).
Question 10
How do you configure memory for a Lambda function?
A) It is fixed
B) You choose between 128 MB and 10,240 MB, CPU is allocated proportionally
C) Automatically
D) Via EC2
See the answer
Answer: B
Memory is configurable from 128 MB to 10,240 MB (10 GB) in 1 MB increments. CPU is allocated proportionally: more memory = more CPU. At 1,769 MB, you get the equivalent of a full vCPU.
Question 11
What are "Environment Variables" in Lambda?
A) System environment variables
B) Configurable key-value pairs accessible by your code
C) Compilation variables
D) Billing variables
See the answer
Answer: B
Environment Variables allow you to pass configurations (DB URLs, API keys, flags) to your function without modifying the code. They can be encrypted with KMS. Accessible via os.environ (Python) or process.env (Node.js).
Question 12
What is a Lambda Layer?
A) A security layer
B) A package of code/libraries shared between multiple functions
C) A network layer
D) A pricing tier
See the answer
Answer: B
A Lambda Layer is a ZIP archive containing libraries, custom runtimes, or other dependencies. Layers are shareable between functions, reducing the deployment package size and simplifying updates.
Question 13
What is a Lambda "cold start"?
A) A cold server start
B) The initial delay when Lambda provisions a new execution environment
C) A startup error
D) An energy-saving mode
See the answer
Answer: B
A cold start occurs when Lambda needs to create a new execution environment (download the code, start the runtime). This adds latency (100ms to a few seconds). Subsequent invocations reuse the environment (warm start).
Question 14
How to reduce cold starts?
A) It's impossible
B) Provisioned Concurrency, keep functions lightweight, avoid VPCs if possible
C) Increase memory only
D) Use Java only
See the answer
Answer: B
Strategies: enable Provisioned Concurrency (pre-warmed environments), reduce package size, avoid unnecessary VPCs (add latency), choose fast-starting runtimes (Python, Node.js vs Java).
Question 15
What is Lambda "Concurrency"?
A) Competition between functions
B) The number of instances of your function running simultaneously
C) Data consistency
D) A type of trigger
See the answer
Answer: B
Concurrency is the number of simultaneous executions of your function. Each concurrent invocation uses a separate execution environment. AWS can scale up to thousands of simultaneous executions.
Question 16
What is the default concurrency limit per region?
A) 100
B) 1,000
C) 10,000
D) Unlimited
See the answer
Answer: B
The default limit is 1,000 concurrent executions per region (shared among all functions). This limit can be increased via a quota request. Reserved Concurrency allows you to guarantee capacity.
Question 17
What is "Reserved Concurrency"?
A) Reserved concurrency for VIPs
B) Guaranteed concurrency capacity for a specific function
C) Backup concurrency
D) Scheduled concurrency
See the answer
Answer: B
Reserved Concurrency reserves part of the account's concurrency capacity for a specific function. It guarantees that the function will always have this capacity but also limits its maximum.
Question 18
What is "Provisioned Concurrency"?
A) Provisional concurrency
B) Pre-initialized execution environments to eliminate cold starts
C) Pending concurrency
D) Temporary concurrency
See the answer
Answer: B
Provisioned Concurrency maintains a specified number of initialized and ready execution environments. This eliminates cold starts but has a cost (you pay even without invocations). Ideal for latency-sensitive applications.
Question 19
How does Lambda access resources in a VPC?
A) Automatically
B) By configuring the function to connect to the VPC (subnets, Security Groups)
C) Via a VPN
D) It's not possible
See the answer
Answer: B
Configure the function with the VPC's subnets and Security Groups. Lambda creates ENIs (Elastic Network Interfaces) in these subnets. Note: this can increase cold start and the function loses direct Internet access (requiring a NAT).
Question 20
If Lambda is in a VPC, how does it access the Internet?
A) Automatically
B) Via a NAT Gateway in a public subnet
C) It's not possible
D) Via VPC Peering
See the answer
Answer: B
A Lambda function in a VPC does not have direct Internet access. To access the Internet (external APIs), configure a NAT Gateway in a public subnet and route the Lambda subnet's traffic to the NAT.
Question 21
What is an IAM Role for Lambda?
A) A role in the team
B) The permissions granted to the function to access AWS resources
C) An IAM user
D) A security group
See the answer
Answer: B
Each Lambda function assumes an execution IAM Role that defines its permissions: read S3, write DynamoDB, publish SNS, write CloudWatch logs, etc. Apply the principle of least privilege.
Question 22
Where are Lambda logs stored?
A) On the function
B) In CloudWatch Logs, group /aws/lambda/function-name
C) In S3
D) In DynamoDB
See the answer
Answer: B
Lambda logs are automatically sent to CloudWatch Logs in a group named /aws/lambda/your-function-name. Each invocation creates log entries. The function needs permissions logs:CreateLogGroup, PutLogEvents.
Question 23
How to test a Lambda function?
A) Only in production
B) Via the console (Test event), AWS CLI, or locally with SAM/LocalStack
C) Only via API Gateway
D) It's not testable
See the answer
Answer: B
Test via: the AWS console (create JSON test events), AWS CLI (aws lambda invoke), AWS SAM CLI for local tests, or LocalStack to emulate Lambda locally. Automate with test frameworks.
Question 24
What is AWS SAM (Serverless Application Model)?
A) A social network
B) An open-source framework to define and deploy serverless applications
C) A monitoring service
D) A type of Lambda
See the answer
Answer: B
AWS SAM is a framework that extends CloudFormation to simplify serverless development. It provides: a simplified syntax to define Lambda/API Gateway/DynamoDB, a CLI for local build/test and deployment.
Question 25
What is a "dead letter queue" (DLQ) for Lambda?
A) A queue for dead messages
B) A destination for failed invocations after retries
C) A priority queue
D) A backup queue
See the answer
Answer: B
The DLQ (SQS or SNS) receives events that failed even after retry attempts. This allows analyzing failures without losing messages. Configure it for asynchronous invocations.
Question 26
What is the difference between synchronous and asynchronous invocation?
A) None
B) Synchronous waits for the response, Asynchronous returns immediately
C) Asynchronous is faster
D) Synchronous is free
See the answer
Answer: B
Synchronous invocation: the caller waits for Lambda's response (API Gateway, CLI with RequestResponse). Asynchronous: the caller receives an immediate ack, Lambda processes in the background with automatic retries (S3 events, SNS).
Question 27
How to version a Lambda function?
A) Via Git only
B) By publishing immutable versions and using aliases
C) It's not possible
D) Automatically
See the answer
Answer: B
Publish immutable versions of your function. Create aliases (pointers) like "prod", "dev" to specific versions. This allows blue/green deployment and rollbacks. $LATEST is the mutable working version.
Question 28
What is a Lambda Alias?
A) A pseudonym
B) A named pointer to a specific version of the function
C) A copy of the function
D) A backup
See the answer
Answer: B
An Alias is a named pointer (e.g., "prod", "dev") to a specific version. You can redirect an alias to a new version without changing trigger configurations. Also supports traffic shifting for canary deployments.
Question 29
What is "Lambda@Edge"?
A) Lambda at the network edge
B) Lambda running at CloudFront edge locations
C) An edge version of Lambda
D) Lambda for IoT
See the answer
Answer: B
Lambda@Edge allows running Lambda functions at CloudFront edge locations, closer to users. Useful for content customization, authentication, redirections, request/response manipulation with very low latency.
Question 30
Which AWS CLI command invokes a Lambda function?
A) aws lambda run
B) aws lambda invoke --function-name MyFunction output.json
C) aws lambda execute
D) aws lambda start
See the answer
Answer: B
The command is aws lambda invoke --function-name FunctionName --payload file.json output.json. It invokes the function with the specified payload and writes the response to the output file.
Result
Count your correct answers:
- 27-30: Excellent - You master AWS Lambda
- 22-26: Good - Some points to review
- 17-21: Average - Review the course before the lab
- Less than 17: Insufficient - Start the course from the beginning
Proceed to the Lambda Lab once you have achieved at least 22 correct answers.