0
0
AWScloud~20 mins

Lambda function concept in AWS - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Lambda Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
service_behavior
intermediate
2:00remaining
What happens when a Lambda function exceeds its configured timeout?

You have set a Lambda function timeout to 10 seconds. The function runs longer than 10 seconds. What is the result?

AThe function restarts automatically and runs again from the start.
BThe function continues running until it finishes, ignoring the timeout.
CThe function pauses and resumes after the timeout period.
DThe function is forcibly stopped and an error is returned.
Attempts:
2 left
💡 Hint

Think about how time limits protect resources in cloud functions.

Architecture
intermediate
2:00remaining
Which AWS service is best to trigger a Lambda function on a schedule?

You want to run a Lambda function every day at 8 AM automatically. Which AWS service should you use to trigger it?

AAmazon S3
BAmazon EventBridge (CloudWatch Events)
CAWS IAM
DAmazon DynamoDB
Attempts:
2 left
💡 Hint

Think about services that can schedule tasks or events.

security
advanced
2:00remaining
What is the best practice for Lambda function permissions to access an S3 bucket?

You want your Lambda function to read files from a specific S3 bucket. Which approach follows the best security practice?

AAttach an IAM role to the Lambda function with permissions limited to read only the specific S3 bucket.
BEmbed AWS access keys with full S3 access inside the Lambda function code.
CGrant public read access to the S3 bucket so Lambda can access it without permissions.
DUse the Lambda function's default execution role without modifying permissions.
Attempts:
2 left
💡 Hint

Consider the principle of least privilege and secure credential management.

Configuration
advanced
2:00remaining
What is the effect of increasing the memory allocation of a Lambda function?

You increase the memory setting of a Lambda function from 128 MB to 1024 MB. What changes occur?

AThe CPU power allocated to the function increases proportionally, potentially reducing execution time.
BOnly the memory increases; CPU power and execution time remain the same.
CThe function's timeout automatically increases to allow longer execution.
DThe function's network bandwidth decreases to balance resource usage.
Attempts:
2 left
💡 Hint

Think about how AWS bundles CPU with memory for Lambda functions.

Best Practice
expert
2:00remaining
How should you handle environment variables in Lambda for sensitive data?

You need to store database passwords for your Lambda function securely. What is the best practice?

AHardcode the passwords inside the Lambda function code for faster access.
BStore the passwords as plain text environment variables in the Lambda configuration.
CUse AWS Secrets Manager or AWS Systems Manager Parameter Store with encryption, and reference them in the Lambda function.
DSend the passwords as part of the Lambda event payload each time it runs.
Attempts:
2 left
💡 Hint

Consider secure storage and retrieval of secrets in AWS.