Courseiva

DVA-C02 Troubleshooting and Optimization Practice Question

A developer is troubleshooting an AWS Lambda function that is timing out. The function has a timeout of 5 seconds and is configured with 128 MB of memory. Which TWO of the following are effective ways to resolve the timeout?

⚠ Common exam trap

Test-takers frequently think increasing the timeout alone is a valid fix, but the DVA-C02 exam emphasizes resolving the root cause (e.g., insufficient resources or inefficient code) rather than just extending the timeout window.

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 memory allocation to 512 MB.

Increasing memory allocation in AWS Lambda proportionally increases CPU and network throughput, which can reduce execution time and prevent timeouts. With 128 MB, the function may be CPU-bound; raising it to 512 MB provides more compute resources, often resolving timeout issues without code changes.

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 memory allocation to 512 MB.

    Why this is correct

    Increasing the memory allocation for an AWS Lambda function directly scales the available CPU power proportionally. This provides more computational resources, allowing the function to process data faster and complete tasks in less time. Additionally, higher memory allocations often come with increased network bandwidth, which can significantly reduce I/O bound delays for functions interacting with other AWS services or external APIs, thereby mitigating potential timeouts.

  • ✗

    Decrease the memory allocation to 64 MB.

    Why it's wrong here

    Decreasing the memory allocation to 64 MB would proportionally reduce the CPU cycles and network bandwidth available to the Lambda function. This limitation would severely constrain the function's ability to perform computations or handle network I/O efficiently, leading to significantly longer execution times. Consequently, the function would be much more prone to exceeding its configured timeout, exacerbating the original troubleshooting problem rather than solving it.

  • ✗

    Deploy the function inside a VPC.

    Why it's wrong here

    Deploying a Lambda function inside a Virtual Private Cloud (VPC) is necessary when the function needs to access private resources within that VPC, such as RDS databases or EC2 instances. However, this configuration introduces additional network overhead because Lambda must provision and attach an Elastic Network Interface (ENI) to the VPC for each execution environment. This ENI provisioning can significantly increase cold start times and add network latency, potentially worsening the function's execution duration and making it more susceptible to timeouts.

  • ✓

    Optimize the function code to reduce execution time.

    Why this is correct

    Optimizing the function code directly addresses the root cause of long execution times by making the logic more efficient. This could involve refactoring algorithms to reduce computational complexity, minimizing unnecessary I/O operations, or implementing better data structures. Efficient code consumes fewer resources and completes its tasks faster, inherently reducing the likelihood of hitting the configured timeout and improving overall performance without relying solely on increased infrastructure.

  • ✗

    Increase the function timeout to 10 seconds.

    Why it's wrong here

    Increasing the function timeout to 10 seconds merely extends the maximum allowed execution duration, preventing the function from prematurely terminating. While this might temporarily stop the timeout errors, it does not resolve the underlying inefficiency causing the function to run slowly. A longer execution time can lead to higher AWS costs due to increased billed duration and can negatively impact the user experience if the function is part of a synchronous request-response flow, as users will wait longer for a response.

Visual reference

Client Recursive Resolver Root DNS (13 root servers) TLD DNS (.com, .org, …) Authoritative example.com query IP addr answer

Quick reference

Cloud Service Model Comparison

ModelYou ManageProvider ManagesExamples
IaaSOS, runtime, apps, dataHardware, hypervisor, networkingEC2, Azure VMs, GCP Compute Engine
PaaSApps and dataOS, runtime, middleware, hardwareElastic Beanstalk, Azure App Service
SaaSData and settings onlyEverything elseMicrosoft 365, Salesforce, Workday
FaaS / ServerlessFunction code onlyInfra, scaling, runtimeLambda, Azure Functions, Cloud Run
CaaSContainers and appsKubernetes, OS, hardwareEKS, AKS, GKE

About these practice questions

One of 1,135 original DVA-C02 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

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.