DVA-C02 Development with AWS Services Practice Question
A developer is building a serverless application using AWS Lambda functions that process events from Amazon SQS. The developer notices that some messages are being processed multiple times. What is the MOST likely cause of this issue?
⚠ Common exam trap
It's easy for candidates to confuse the visibility timeout with the Lambda function timeout or think that increasing concurrency or batch size causes duplicates, when in fact the visibility timeout directly controls the window for duplicate processing.
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 SQS visibility timeout is too short for the Lambda function's execution time.
When an SQS message is processed by a Lambda function, the message becomes invisible to other consumers for the duration of the visibility timeout. If the Lambda function takes longer to process the message than the visibility timeout, SQS makes the message visible again and can deliver it to another consumer (or the same Lambda function in a new invocation), causing duplicate processing. This is the most likely cause of messages being processed multiple times.
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's reserved concurrency is set too high.
Why it's wrong here
Reserved concurrency dictates the maximum number of concurrent executions a Lambda function can have at any given time. Setting it too high merely allows for more parallel invocations if demand exists, but it does not inherently cause a single SQS message to be processed multiple times. Its purpose is to prevent resource exhaustion or throttling, not to duplicate message processing. Therefore, this configuration would not lead to duplicate messages being processed.
- ✓
The SQS visibility timeout is too short for the Lambda function's execution time.
Why this is correct
When an SQS message is received by a Lambda function, it becomes temporarily invisible to other consumers for the duration of the visibility timeout. If the Lambda function's processing time exceeds this timeout, the message will reappear in the queue, becoming available for another Lambda invocation to pick up and process again. This scenario directly leads to duplicate message processing, as the original invocation might still be working on the message while a new one begins.
- ✗
The SQS queue has a dead-letter queue configured.
Why it's wrong here
A dead-letter queue (DLQ) is designed to store messages that a consumer repeatedly fails to process successfully after a specified number of retries. While it is a crucial part of robust message processing, its presence or configuration does not cause messages to be processed multiple times by the primary queue's consumers. Instead, it acts as a repository for unprocessable messages, preventing them from blocking the main queue.
- ✗
The Lambda function's batch size is set to more than 1.
Why it's wrong here
Setting a Lambda function's batch size to more than one means that the function will receive and process multiple SQS messages in a single invocation. However, each message within that batch is distinct and is processed only once by that specific invocation. This configuration optimizes throughput by reducing the number of Lambda invocations, but it does not cause individual messages to be processed redundantly across different invocations.
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
One of 724 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 →
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.