DVA-C02 Development with AWS Services Practice Question
A developer is building a serverless application using AWS Lambda and Amazon DynamoDB. The Lambda function reads from a DynamoDB table. The function fails with a timeout error when processing large items. What is the MOST efficient solution?
⚠ Common exam trap
Candidates often think that a timeout error should always be fixed by increasing the timeout limit (Option B). However, for resource-intensive tasks like processing large items, increasing the memory (Option A) is the most efficient solution because it scales CPU power, reducing execution time and often lowering overall costs.
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 memory.
In AWS Lambda, CPU power is allocated proportionally to the configured memory. When a Lambda function times out while processing large items or files, it is typically due to CPU bottlenecks (such as serialization, deserialization, or processing overhead). Increasing the memory (Option A) automatically increases the CPU power, which speeds up execution and resolves the timeout. Simply increasing the timeout (Option B) allows the function to run longer but does not address the performance bottleneck and can lead to higher latency and costs.
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 memory.
Why this is correct
Increasing Lambda function memory allocates more CPU and network bandwidth, which can accelerate execution for CPU-bound or network-intensive tasks. However, if the function's processing time inherently exceeds its configured timeout, simply adding more memory will not prevent termination. The function will still be stopped once the timeout limit is reached, regardless of its available resources, making this an indirect and often insufficient solution for a timeout issue.
- ✗
Increase the Lambda function timeout.
Why it's wrong here
Increasing the Lambda function timeout directly addresses scenarios where a function requires more time to complete its execution. This adjustment allows the function to process larger data sets or perform more complex, time-consuming operations without being prematurely terminated by the AWS Lambda service. It is the most direct and effective solution when the issue is the function running out of its allocated execution time.
- ✗
Enable Lambda provisioned concurrency.
Why it's wrong here
Enabling Lambda provisioned concurrency is designed to reduce cold start latencies by keeping execution environments pre-initialized and ready. While this improves the responsiveness of the function for subsequent invocations, it does not extend the maximum allowed execution duration for a single invocation. A function utilizing provisioned concurrency will still be subject to its configured timeout value and will terminate if that limit is exceeded.
- ✗
Increase the DynamoDB read capacity units.
Why it's wrong here
Increasing DynamoDB Read Capacity Units (RCUs) enhances the database's ability to handle a higher volume of read requests per second, thereby improving data retrieval speed and throughput. While faster data access can slightly reduce the overall execution time of a Lambda function, it does not modify or extend the fundamental timeout limit imposed on the Lambda function itself. The function's maximum allowed runtime remains unchanged, irrespective of DynamoDB's read performance.
Visual reference
Quick reference
Cloud Service Model Comparison
| Model | You Manage | Provider Manages | Examples |
|---|---|---|---|
| IaaS | OS, runtime, apps, data | Hardware, hypervisor, networking | EC2, Azure VMs, GCP Compute Engine |
| PaaS | Apps and data | OS, runtime, middleware, hardware | Elastic Beanstalk, Azure App Service |
| SaaS | Data and settings only | Everything else | Microsoft 365, Salesforce, Workday |
| FaaS / Serverless | Function code only | Infra, scaling, runtime | Lambda, Azure Functions, Cloud Run |
| CaaS | Containers and apps | Kubernetes, OS, hardware | EKS, AKS, GKE |
Go deeper
Related to this question
About these practice questions
This DVA-C02 question is part of Courseiva's 1,135-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam 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.