0
0
AWScloud~20 mins

Lambda with S3 event triggers in AWS - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Lambda S3 Event Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
service_behavior
intermediate
2:00remaining
What happens when an S3 event triggers a Lambda function?

An S3 bucket is configured to trigger a Lambda function on object creation. What is the expected behavior when a new file is uploaded?

AThe S3 bucket sends an email notification instead of triggering Lambda.
BThe Lambda function runs only if the file is larger than 1 GB.
CThe Lambda function must be manually invoked after the file upload.
DThe Lambda function runs automatically with event details about the new file.
Attempts:
2 left
💡 Hint

Think about how event-driven services work in AWS.

Configuration
intermediate
2:00remaining
Which IAM permission is required for Lambda to read an S3 object?

You want your Lambda function to read files from an S3 bucket when triggered. Which IAM permission must be included in the Lambda execution role?

A"s3:GetObject" permission on the bucket
B"s3:PutObject" permission on the bucket
C"s3:DeleteObject" permission on the bucket
D"lambda:InvokeFunction" permission on the bucket
Attempts:
2 left
💡 Hint

Consider what action Lambda needs to do to read a file.

Architecture
advanced
2:00remaining
How to design a fault-tolerant Lambda triggered by S3 events?

You want to ensure your Lambda function processes every S3 upload event even if it fails initially. Which architecture best supports this?

AUse S3 event to trigger Lambda without retries or error handling.
BSet Lambda timeout to 1 second and ignore failures.
CConfigure S3 event to trigger Lambda with a dead-letter queue (DLQ) for failed events.
DManually re-upload files if Lambda fails to process them.
Attempts:
2 left
💡 Hint

Think about how to handle failures automatically.

security
advanced
2:00remaining
What is the safest way to restrict Lambda access to only one S3 bucket?

You want your Lambda function to access only a specific S3 bucket and no others. Which IAM policy condition achieves this?

AUse a policy with "Resource" set to the specific bucket ARN and "Action" to "s3:GetObject".
BGrant "s3:*" permission on all buckets and rely on Lambda code to check bucket name.
CAttach a policy allowing "s3:GetObject" on "arn:aws:s3:::*" (all buckets).
DUse a policy with "Condition" to allow access only during business hours.
Attempts:
2 left
💡 Hint

Restrict permissions by resource ARN rather than broad access.

Best Practice
expert
2:00remaining
How to optimize Lambda cold start time when triggered by S3 events?

Your Lambda function triggered by S3 events has high cold start latency. Which approach best reduces this delay?

AIncrease Lambda memory to maximum without testing impact.
BUse provisioned concurrency to keep Lambda instances warm.
CDisable S3 event triggers and invoke Lambda manually.
DUse a larger S3 bucket to speed up event delivery.
Attempts:
2 left
💡 Hint

Think about how to keep Lambda ready to run instantly.