DVA-C02 Troubleshooting and Optimization Practice Question
A developer is troubleshooting a Lambda function that intermittently times out. The function makes HTTP requests to an external API. The function's CloudWatch logs show 'Task timed out after 3.01 seconds'. What is the MOST likely cause?
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
✓
The Lambda function timeout is set to 3 seconds, but the HTTP request takes longer.
The Lambda function timeout is set to 3 seconds, and the HTTP request to the external API takes longer than that, causing the 'Task timed out after 3.01 seconds' error. Option B is incorrect because throttling due to insufficient reserved concurrency would result in a 'Rate exceeded' error, not a timeout. Option C is incorrect because if the function couldn't reach the external API due to VPC configuration, it would result in a connection error, not a timeout. Option D is incorrect because a missing IAM role would prevent the function from executing at all, and the logs show the function started execution.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
The Lambda function timeout is set to 3 seconds, but the HTTP request takes longer.
Why this is correct
The default timeout for an AWS Lambda function is indeed 3 seconds. When an HTTP request or any other operation within the function exceeds this configured duration, Lambda forcefully terminates the execution, logging a 'Task timed out' error. The log showing 3.01 seconds precisely indicates that the function was terminated just after exceeding its allowed execution time, making the long-running HTTP request the root cause of the observed timeout.
- ✗
The Lambda function has insufficient reserved concurrency causing throttling.
Why it's wrong here
Insufficient reserved concurrency for a Lambda function would lead to throttling, preventing new invocations from starting. This scenario manifests as 'Rate exceeded' or 'TooManyRequestsException' errors, indicating that Lambda cannot allocate resources for the request. It does not result in a function timing out after 3 seconds of execution, as throttling occurs *before* the function even begins processing the event.
- ✗
The Lambda function is not configured with a VPC and cannot reach the external API.
Why it's wrong here
AWS Lambda functions, by default, operate within an AWS-managed network and have direct internet access without requiring a VPC configuration. A function only needs to be configured within a VPC if it must access private resources, such as an RDS database or EC2 instance, within that specific VPC. If network connectivity to an external API were the issue, the function would likely experience a connection timeout or host unreachable error *within* its execution, not a Lambda service-level timeout after 3 seconds.
- ✗
The Lambda function is not starting execution due to a missing IAM role.
Why it's wrong here
A missing or improperly configured IAM role would prevent the Lambda function from being invoked or accessing necessary AWS services, resulting in an 'AccessDeniedException' or 'InvalidParameterValueException' error during invocation or startup. The function would not even begin execution to then time out after 3 seconds. The timeout message indicates the function successfully started and was executing code before being terminated by the Lambda service.
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
Courseiva writes every DVA-C02 question from scratch — 1,135 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.