DVA-C02 Development with AWS Services Practice Question
A developer is building a serverless application using AWS Lambda to process images uploaded to an S3 bucket. The Lambda function needs to resize the image and store the result in another S3 bucket. The developer notices that the Lambda function fails intermittently with timeout errors for large images. What is the MOST efficient solution to resolve this issue?
⚠ Common exam trap
The trap here is that candidates often overcomplicate the solution by considering orchestration or parallel processing (Options C and D), when the simplest and most efficient fix is to adjust the Lambda function's resource limits, which directly control execution time and processing capacity.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Increase the Lambda function timeout and memory allocation to accommodate larger images.
Increasing the Lambda function timeout and memory allocation directly addresses the root cause of the failure: large images require more processing time and memory. Lambda's CPU and I/O throughput scale proportionally with allocated memory, so raising both parameters provides the necessary resources to complete the resize operation within the function's execution environment.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Increase the Lambda function timeout and memory allocation to accommodate larger images.
Why this is correct
Increasing the Lambda function's memory allocation directly scales its CPU power proportionally, providing more computational resources to process larger and more complex images efficiently. Concurrently, extending the timeout allows the function sufficient time to complete computationally intensive tasks like high-resolution image resizing or complex transformations without premature termination. This direct adjustment of allocated resources and execution duration is the most straightforward solution for handling larger image files within a single Lambda invocation.
- ✗
Limit the S3 event notification to only trigger for images smaller than 5 MB.
Why it's wrong here
Limiting S3 event notifications to only trigger for images smaller than 5 MB would prevent the Lambda function from being invoked for any images exceeding that size. This approach explicitly ignores the problem statement's requirement to process large images, effectively sidestepping the challenge rather than solving it. It would result in larger images not being processed at all, failing to meet the application's core functionality.
- ✗
Refactor the Lambda function to use multi-threading for parallel processing of image chunks.
Why it's wrong here
While some Lambda runtimes support multi-threading, refactoring a function to use it for parallel processing of image chunks within a single invocation does not directly address insufficient memory or an inadequate timeout. Multi-threading might optimize CPU utilization for I/O-bound tasks or concurrent operations, but it does not increase the total allocated CPU or memory resources for the invocation, nor does it extend the maximum execution time. If the overall task for a single large image exceeds the Lambda's configured resource limits or timeout, multi-threading alone will not prevent failure.
- ✗
Use AWS Step Functions to orchestrate the image processing in smaller steps.
Why it's wrong here
AWS Step Functions orchestrates workflows by chaining together multiple steps, potentially involving several Lambda functions or other AWS services. While it can break down a complex process into smaller, manageable tasks, each individual Lambda function within that workflow still operates under its own memory and timeout constraints. Step Functions would manage the state and transitions between these steps, but it does not inherently increase the resource allocation or timeout for any single Lambda invocation that is still responsible for processing a large image chunk.
Visual reference
Quick reference
AWS S3 Storage Class Comparison
| Storage Class | Min Duration | Retrieval | Use Case |
|---|---|---|---|
| S3 Standard | None | Immediate | Frequently accessed data |
| S3 Standard-IA | 30 days | Immediate | Infrequent access, rapid retrieval |
| S3 One Zone-IA | 30 days | Immediate | Non-critical infrequent data |
| S3 Intelligent-Tiering | None | Immediate–hours | Unknown or changing access patterns |
| S3 Glacier Instant | 90 days | Milliseconds | Archive with instant retrieval |
| S3 Glacier Flexible | 90 days | Minutes–hours | Archive, flexible retrieval |
| S3 Glacier Deep Archive | 180 days | Hours | Long-term compliance archive |
Go deeper
Related to this question
About these practice questions
Courseiva writes every DVA-C02 question from scratch — 724 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This DVA-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DVA-C02 exam.