Courseiva

DVA-C02 Development with AWS Services Practice Question

A developer is building an order-processing workflow using AWS Step Functions. The state machine has a Task state that invokes a Lambda function to charge a credit card. The Lambda function occasionally returns a transient error due to a downstream payment gateway timeout. The developer must ensure the workflow automatically retries the charge up to 3 times with increasing intervals between attempts, without modifying the state machine definition for every error type. Which solution meets these requirements with the LEAST operational overhead?

⚠ Common exam trap

The trap here is assuming that retries must be implemented in code or with additional services, when Step Functions provides a declarative Retry field with exponential backoff.

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 Retry field on the Task state with ErrorEquals set to States.TaskFailed, IntervalSeconds set to 2, MaxAttempts set to 3, and BackoffRate set to 2.0.

Step Functions Task states support built-in retry policies through the Retry field, which accepts ErrorEquals, IntervalSeconds, MaxAttempts, and BackoffRate. Using States.TaskFailed as the error matcher catches errors returned by the Lambda function, and BackoffRate greater than 1.0 produces the required increasing intervals. This declarative approach requires no changes to the Lambda code or additional services, minimizing operational overhead.

Answer analysis

Option-by-option breakdown

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

  • ✗

    Wrap the Lambda invocation in an SQS queue with a visibility timeout and a dead-letter queue, and have the state machine poll the queue.

    Why it's wrong here

    Introducing SQS adds a polling mechanism and changes the synchronous request/response pattern of the workflow. SQS redrive policies do not provide exponential backoff with increasing intervals, and the state machine would need custom logic to correlate responses, increasing operational overhead rather than reducing it.

  • ✓

    Configure a Retry field on the Task state with ErrorEquals set to States.TaskFailed, IntervalSeconds set to 2, MaxAttempts set to 3, and BackoffRate set to 2.0.

    Why this is correct

    The Retry field on a Task state natively supports ErrorEquals, IntervalSeconds, MaxAttempts, and BackoffRate. Setting ErrorEquals to States.TaskFailed catches Lambda function errors, and BackoffRate 2.0 doubles the wait each retry, satisfying the increasing-interval requirement without code changes or additional services.

  • ✗

    Modify the Lambda function to implement its own retry loop with exponential backoff using the AWS SDK retry configuration.

    Why it's wrong here

    Implementing retries inside the Lambda function ties up compute time during backoff waits and can exceed the function timeout. It also mixes business logic with resilience logic, and the SDK retry configuration applies to AWS API calls, not to arbitrary downstream payment gateway timeouts. The requirement is for workflow-level retries.

  • ✗

    Enable AWS X-Ray tracing on the Lambda function and use CloudWatch alarms to trigger a new state machine execution on failure.

    Why it's wrong here

    X-Ray and CloudWatch alarms provide observability, not retry orchestration. Triggering a new execution on failure does not retry the specific Task state within the same workflow, may duplicate charges, and requires custom alarm-to-Lambda wiring. This approach fails to meet the automatic retry with backoff requirement.

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 and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official Amazon Web Services exam blueprint

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.