Courseiva

DVA-C02 Development with AWS Services Practice Question

A developer is building a serverless application that uses AWS Step Functions to orchestrate multiple AWS Lambda functions. The workflow involves three steps: validate input, process data, and store results. The developer notices that the workflow occasionally fails due to transient errors in the process data step. The developer wants to implement error handling so that the workflow retries the process data step up to three times with an exponential backoff. Additionally, if all retries fail, the workflow should send a notification to an Amazon SNS topic and transition to a failure state. The developer has defined the state machine in Amazon States Language (ASL). How should the developer configure the state machine?

⚠ Common exam trap

DVA-C02 often tests the misconception that Retry and Catch can be defined at the workflow (top) level in ASL — they cannot; they must be attached to individual Task, Parallel, or Map states.

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

✓

In the process data state definition, add a Retry field with MaxAttempts: 3 and BackoffRate: 2, and add a Catch field that transitions to a failure state and sends an SNS notification.

In Amazon States Language (ASL), retry and error handling are configured per-state, not at the workflow level. The process data state should include a Retry block with MaxAttempts: 3 and BackoffRate: 2 (which produces exponential backoff: 1s, 2s, 4s by default), and a Catch block that matches the error and transitions to a failure state. The failure state can be a Task state invoking SNS Publish, or the Catch can route to a state that publishes to SNS before ending in a Fail state.

Answer analysis

Option-by-option breakdown

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

  • ✗

    Write custom retry logic inside the Lambda function code and catch exceptions there.

    Why it's wrong here

    While implementing custom retry logic within a Lambda function is technically feasible, it is not the recommended serverless best practice when using AWS Step Functions. This approach introduces unnecessary complexity to the Lambda code, increases execution time and cost for failed attempts within the function, and duplicates the robust, declarative retry and error handling capabilities natively provided by Step Functions. Step Functions' built-in mechanisms are designed for orchestrating complex workflows reliably and efficiently.

  • ✗

    Modify the IAM execution role to allow the state machine to call SNS and then use a ResultPath to handle errors.

    Why it's wrong here

    Modifying the IAM execution role to permit SNS calls is a necessary prerequisite for sending notifications, but `ResultPath` is fundamentally misapplied here for error handling. `ResultPath` is used to control where a state's output is placed in the overall state input, allowing for merging or overwriting data within the state machine's context. It does not define error conditions or trigger error-specific transitions; error handling in Step Functions requires `Catch` fields to specify error types and subsequent states.

  • ✓

    In the process data state definition, add a Retry field with MaxAttempts: 3 and BackoffRate: 2, and add a Catch field that transitions to a failure state and sends an SNS notification.

    Why this is correct

    This option correctly leverages AWS Step Functions' native error handling and retry mechanisms. Adding a `Retry` field to the specific state definition allows for automatic retries with exponential backoff (`BackoffRate: 2`) and a maximum number of attempts (`MaxAttempts: 3`), enhancing the workflow's resilience against transient failures. Subsequently, a `Catch` field provides a robust fallback mechanism, directing the workflow to a designated failure state and enabling an SNS notification for operational awareness after all retries are exhausted.

  • ✗

    Add a Retry field at the workflow level and a Catch field at the workflow level.

    Why it's wrong here

    AWS Step Functions' Amazon States Language (ASL) mandates that `Retry` and `Catch` fields are defined within individual state definitions, not at the top-level workflow definition. These fields are designed to handle transient failures or specific errors originating from a particular state's execution, allowing for granular control over error recovery. Attempting to define them at the workflow level would result in an invalid state machine definition, as the ASL syntax does not support such global error handling constructs.

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

Courseiva writes every DVA-C02 question from scratch — 1,135 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

1 more way 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 building a serverless application using AWS Step Functions to orchestrate multiple AWS Lambda functions. One of the Lambda functions occasionally fails due to a transient error. The developer wants the Step Functions execution to automatically retry the failed task up to three times with exponential backoff. Which configuration should the developer set in the Step Functions state machine definition?

medium
  • A.Add a Retry clause in the Lambda function's configuration with a maximum retry count of 3.
  • ✓ B.Use the Amazon States Language (ASL) Retry field in the Task state definition.
  • C.Wrap the Lambda function invocation in a custom while loop within the function code.
  • D.Use the Amazon States Language Catch field in the Task state to redirect to a retry logic.

Why B: The Amazon States Language (ASL) provides a native Retry field within a Task state definition that allows you to specify retry policies, including a maximum retry count and exponential backoff. This is the intended mechanism for handling transient failures in Step Functions without requiring custom code or external retry logic.

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.