Question 419 of 1,616
Development with AWS ServiceshardMultiple ChoiceObjective-mapped

SQS Dead-Letter Queue with Lambda Retries

This DVA-C02 practice question tests your understanding of development with aws services. The scenario asks you to isolate a root cause — eliminate options that address a different problem before choosing. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

A Lambda function processes messages from an SQS queue. The function occasionally fails due to network timeouts when calling an external API. The developer wants to retry failed messages automatically. What should the developer do?

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

Configure a dead-letter queue for the SQS queue and set the Lambda function's maximum retries to 2.

Option C is correct because it combines an SQS dead-letter queue (DLQ) with Lambda's built-in retry mechanism. When the Lambda function fails (e.g., due to a network timeout), Lambda automatically retries the invocation up to 2 times (the configured maximum retries). After exhausting those retries, the message is sent to the SQS DLQ for later analysis or reprocessing, ensuring no messages are lost. This approach directly addresses the need for automatic retries without manual intervention.

Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Answer analysis

Option-by-option breakdown

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

  • Enable SQS redrive policy to automatically retry after a failure.

    Why it's wrong here

    SQS does not have an automatic retry policy; Lambda handles retries.

  • Configure a dead-letter queue on the Lambda function to capture failed events.

    Why it's wrong here

    Lambda DLQ is for asynchronous invocations; for SQS, it's better to use SQS DLQ.

  • Configure a dead-letter queue for the SQS queue and set the Lambda function's maximum retries to 2.

    Why this is correct

    SQS DLQ stores messages that fail after retries, and Lambda retries can be configured.

    Related concept

    Read the scenario before looking for a memorised answer.

  • Increase the Lambda function's timeout to 15 minutes.

    Why it's wrong here

    Increasing timeout does not automatically retry failed messages.

Common exam traps

Common exam trap: answer the scenario, not the keyword

The trap here is that candidates often confuse the Lambda function's dead-letter queue (which captures invocation records) with the SQS queue's dead-letter queue (which captures messages after processing failures), leading them to choose Option B instead of the correct combination in Option C.

Detailed technical explanation

How to think about this question

Under the hood, when an SQS queue triggers a Lambda function, Lambda polls the queue and invokes the function synchronously. If the function returns an error or times out, Lambda automatically retries the invocation based on the function's `MaximumRetryAttempts` setting (default 2, configurable up to 2 for SQS triggers). After exhausting retries, the message is either discarded or, if a DLQ is configured on the SQS queue, moved to the DLQ. The SQS DLQ must be of type Standard or FIFO and should have a `maxReceiveCount` set to match the total number of invocations (including retries) before moving messages. A real-world scenario is when an external payment API intermittently fails; using this pattern ensures that transient failures are retried automatically, and persistent failures are isolated in the DLQ for manual inspection.

KKey Concepts to Remember

  • Read the scenario before looking for a memorised answer.
  • Find the constraint that changes the correct option.
  • Eliminate answers that are true in general but not in this case.

TExam Day Tips

  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Key takeaway

Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Real-world example

How this comes up in practice

A healthcare organisation deploys an application with a public-facing web tier and a private database tier. The database subnet has no public IP and only accepts connections from the web tier's security group. Questions like this test whether you can design cloud network isolation using VNets/VPCs, subnets, and security group rules.

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

What to study next

Got this wrong? Here's your next step.

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

Related practice questions

Related DVA-C02 practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free DVA-C02 practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this DVA-C02 question test?

Development with AWS Services — This question tests Development with AWS Services — Read the scenario before looking for a memorised answer..

What is the correct answer to this question?

The correct answer is: Configure a dead-letter queue for the SQS queue and set the Lambda function's maximum retries to 2. — Option C is correct because it combines an SQS dead-letter queue (DLQ) with Lambda's built-in retry mechanism. When the Lambda function fails (e.g., due to a network timeout), Lambda automatically retries the invocation up to 2 times (the configured maximum retries). After exhausting those retries, the message is sent to the SQS DLQ for later analysis or reprocessing, ensuring no messages are lost. This approach directly addresses the need for automatic retries without manual intervention.

What should I do if I get this DVA-C02 question wrong?

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

What is the key concept behind this question?

Read the scenario before looking for a memorised answer.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

1 more ways this is tested on DVA-C02

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. A developer is writing an AWS Lambda function that processes messages from an Amazon SQS queue. The function should process each message at least once, but duplicates are acceptable. The function is triggered by a Lambda event source mapping. If the function returns an error, what happens to the message?

easy
  • A.The message is sent to a dead-letter queue (DLQ).
  • B.The message is deleted from the queue to prevent duplicate processing.
  • C.Lambda automatically retries the function with a 1-minute delay.
  • D.The message remains in the queue and becomes visible after the visibility timeout expires.

Why D: When a Lambda function invoked by an SQS event source mapping returns an error, the message is not deleted from the queue. Instead, it remains in the queue and becomes visible again after the visibility timeout expires. This allows the function to retry processing the message, ensuring at-least-once processing. The default behavior is to retry based on the queue's redrive policy, not to immediately send the message to a DLQ or delete it.

Keep practising

More DVA-C02 practice questions

Last reviewed: Jul 4, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

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.