Courseiva

DVA-C02 Development with AWS Services Practice Question

Exhibit

Error: Function 'my-function' timed out after 3 seconds

A developer invokes an AWS Lambda function and receives a timeout error. The function is configured with a 3-second timeout. The developer needs to process data that sometimes takes up to 10 seconds. What should the developer do?

⚠ Common exam trap

Candidates often confuse increasing memory (which can improve performance but does not extend the timeout) with solving a timeout error, or incorrectly assume that changing the invocation type to async will allow the function to run longer.

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 to 10 seconds.

The error indicates the Lambda function is timing out because its configured timeout of 3 seconds is insufficient for processing that sometimes takes up to 10 seconds. Option B directly addresses this by increasing the timeout to 10 seconds, which is within the maximum Lambda timeout of 15 minutes (900 seconds). This ensures the function can complete its execution without being prematurely terminated.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Change the invocation type to Event (async).

    Why it's wrong here

    Changing the invocation type to "Event" makes the Lambda function asynchronous, meaning the caller does not wait for a response and the invocation is queued for processing. Although the caller receives an immediate acknowledgment, the Lambda function itself still operates under its own configured timeout limit. If the function's internal logic takes longer than this set timeout, it will still be terminated by the Lambda service, regardless of the asynchronous invocation method.

  • ✓

    Increase the Lambda function timeout to 10 seconds.

    Why this is correct

    The Lambda function timeout setting directly controls the maximum amount of time a function is allowed to execute before the AWS Lambda service forcibly terminates it. If a function is consistently timing out, it indicates that its current execution duration exceeds the configured limit. Increasing this timeout value to 10 seconds directly addresses the problem by providing the function with sufficient time to complete its operations successfully, preventing premature termination.

  • ✗

    Increase the memory allocation for the Lambda function.

    Why it's wrong here

    Increasing the memory allocation for a Lambda function provides more computational resources, including a proportional increase in CPU power. This can potentially reduce the execution time for compute-intensive tasks, thereby indirectly preventing a timeout if the function was close to its limit. However, it does not alter the *configured* timeout duration itself; if the function's logic inherently requires more time than the set timeout, even with maximum memory, it will still be terminated.

  • ✗

    Set reserved concurrency to 1.

    Why it's wrong here

    Setting reserved concurrency to 1 limits the number of simultaneous executions of the Lambda function to a single instance. While this can prevent resource contention or throttling issues for downstream services, it has no direct impact on the maximum execution duration of an individual function invocation. A function will still terminate if its processing exceeds the configured timeout, irrespective of how many instances are running concurrently.

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

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 →

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.