DVA-C02 Development with AWS Services Practice Question
A developer is deploying a Node.js application on AWS Lambda. The function uses the 'axios' library to call an external API. After deployment, the function times out after 3 seconds. The external API response time is normally under 500 ms. What should the developer do to resolve this issue?
⚠ Common exam trap
AWS often tests your understanding of Lambda VPC networking. Candidates frequently assume that increasing the timeout (Option A) or memory (Option D) will solve timeout issues, but if the root cause is a lack of internet access due to VPC configuration, the function will continue to time out regardless of the timeout limit or memory allocated.
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
✓
Remove the Lambda function from the VPC.
When a Lambda function is configured to run inside a VPC, it loses its default internet access. If the function needs to call an external API, the connection will hang and eventually time out. Increasing the timeout (Option A) will not resolve this, as the network path is blocked. To resolve this, the developer should either configure a NAT Gateway in the VPC or, if VPC resources are not required, remove the Lambda function from the VPC (Option C) to restore default internet access.
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 to 10 seconds.
Why it's wrong here
Increasing the Lambda function timeout is the correct solution when an external dependency, such as an API call, occasionally exceeds the default execution limit. AWS Lambda functions have a configurable timeout, with a default of 3 seconds. If an external API call, especially one with variable latency, occasionally takes longer than this default, the Lambda function will be prematurely terminated, leading to invocation failures. Increasing the timeout to 10 seconds allows the function sufficient time to complete the external call and process its response, preventing these intermittent failures.
- ✗
Increase the Lambda function reserved concurrency.
Why it's wrong here
Increasing the Lambda function reserved concurrency dictates the maximum number of simultaneous executions for a specific Lambda function, preventing it from consuming all available account concurrency. While crucial for performance and resource management, especially during peak loads, reserved concurrency has no bearing on the duration a single function invocation is allowed to run. A function will still time out after its configured duration, regardless of how many concurrent instances are reserved or available for execution.
- ✓
Remove the Lambda function from the VPC.
Why this is correct
Removing the Lambda function from a Virtual Private Cloud (VPC) is unrelated to addressing function timeouts. Placing a Lambda function within a VPC allows it to access private resources like Amazon RDS databases or EC2 instances within that VPC. While incorrect VPC configuration (e.g., missing a NAT Gateway for internet access) can cause functions to hang and eventually time out due to network issues, the VPC configuration itself does not directly control or modify the function's execution timeout setting, which is an independent parameter.
- ✗
Increase the Lambda function memory to 1024 MB.
Why it's wrong here
Increasing the Lambda function memory allocation directly impacts its available CPU power and, consequently, its execution speed for CPU-bound tasks. While more memory can reduce the overall execution duration for computationally intensive operations by providing more processing resources, it does not inherently extend the maximum allowed execution time (timeout). The timeout is a distinct configuration that defines the hard limit for how long a function can run, irrespective of its memory setting.
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.