Courseiva
Development with AWS ServicesmediumMultiple ChoiceObjective-mapped

DVA-C02 Development with AWS Services Practice Question

A developer is deploying a Lambda function that processes messages from an SQS queue. The queue has a batch size of 10. To optimize cost and performance, the developer wants to minimize the number of Lambda invocations while ensuring that all messages are processed within the SQS visibility timeout. Which configuration should the developer use?

⚠ Common exam trap

Test-takers frequently confuse Lambda timeout with SQS visibility timeout, thinking they should be equal or that increasing both is safe, but the key is to keep Lambda timeout shorter to allow timely retries and avoid message duplication.

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

Set the Lambda function timeout to less than the SQS visibility timeout.

Setting the Lambda function timeout to less than the SQS visibility timeout ensures that the function completes (success or failure) before the message visibility timeout expires. This prevents the message from becoming visible again while the function is still running, which would cause duplicate invocations. If the function fails, the message remains in the queue and becomes visible again after the original visibility timeout, allowing for reprocessing without overlapping executions. This configuration keeps the number of invocations to one per batch for successful processing and avoids unintended duplicates, rather than adding extra retries.

Answer analysis

Option-by-option breakdown

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

  • Set the Lambda function timeout to less than the SQS visibility timeout.

    Why this is correct

    This ensures messages are processed before becoming visible again, reducing duplicate invocations.

  • Increase the SQS visibility timeout to 5 minutes and set Lambda timeout to 5 minutes.

    Why it's wrong here

    Lambda timeout should be less than visibility timeout to allow for retries.

  • Configure the Lambda function to process messages asynchronously.

    Why it's wrong here

    SQS is already asynchronous; this doesn't address the visibility timeout issue.

  • Set the Lambda reserved concurrency to 1 to limit concurrent executions.

    Why it's wrong here

    This would cause throttling and delays, not optimize cost/performance.

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 724-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.