Skip to content

Developer - Associate Practice Questions

Prepare for DVA-C02 with more than an answer.

212 questions in the full set20 sample questionsUpdated Feb 3, 2026

Unlock the full exam and previous versions

  • v1Version 1 212 questions Current
  • DVA-C01Legacy AWS Certified Developer - Associate 350 questions Locked
Exam fee
$150 USD
Level
Associate
Domains covered on the exam 4
  1. Development with AWS Services32%
  2. Security26%
  3. Deployment24%
  4. Troubleshooting and Optimization18%
  1. 1

    A development team is building a microservices application where services communicate asynchronously. One service, the OrderProcessor, needs to receive messages from multiple other services (e.g., PaymentService, InventoryService). The team wants to decouple these services so that producer services do not need to know about the consumer. The OrderProcessor should receive all messages in a single, durable queue. How should the developer design this architecture?

    Show answer details

    Correct answer: B

    This architecture, known as the fanout pattern, is ideal for decoupling multiple producers from one or more consumers. The producer services only need to know about the single SNS topic endpoint. The SNS topic can then deliver messages to multiple subscribers. By subscribing an SQS queue to the topic, the messages become durable and can be processed asynchronously by the OrderProcessor. This decouples the services and provides a reliable messaging channel.

  2. 2

    Case Study: E-commerce Order Processing Workflow

    A rapidly growing e-commerce company is re-architecting its monolithic order processing system into a serverless, microservices-based architecture on AWS. The goal is to improve scalability, reliability, and the speed of feature development. The company has identified several distinct steps in the order processing workflow that need to be orchestrated.

    The desired workflow is as follows: When a new order is placed, the system must first ValidateOrder. If validation is successful, it must concurrently ProcessPayment and UpdateInventory. Both of these concurrent tasks must complete successfully before the system proceeds to ShipOrder. If either ProcessPayment or UpdateInventory fails, a HandleFailure step must be executed, which notifies the support team and attempts to roll back any changes. The entire process should be traceable and have built-in error handling and retry logic.

    The development team consists of developers proficient in writing AWS Lambda functions for business logic. They want a solution that allows them to focus on the code for each step (e.g., ValidateOrder, ProcessPayment) without managing the complex state transitions, error handling, and parallel execution logic. The solution must provide a visual representation of the workflow for easier debugging and understanding.

    Which AWS service should the developer choose to orchestrate this multi-step, serverless workflow while meeting all the stated requirements?

    Show answer details

    Correct answer: C

    AWS Step Functions is designed specifically for orchestrating multi-step workflows involving services like AWS Lambda. It allows developers to define the workflow logic, including sequential steps, parallel execution (Parallel state), error handling (Catch blocks), and retries, in a declarative JSON-based language (Amazon States Language). Step Functions manages the state transitions, provides a visual representation of the workflow execution in the console, and allows developers to focus solely on the business logic within their Lambda functions. This perfectly matches all the requirements of the case study.

  3. 3

    A developer needs to configure an Amazon Cognito user pool. After a user signs up, a welcome email must be sent. Additionally, when a user signs in, the event must be logged to a custom analytics service via an API call. Which Amazon Cognito features should be used to meet these requirements with the LEAST amount of custom infrastructure? (Select TWO)

    Show answer details

    Correct answer: A, B

    Amazon Cognito User Pools have built-in functionality to send emails for various events, including user sign-up and verification. A developer can customize the message templates directly in the Cognito console or via the API, which is the simplest way to send a welcome email.

    Cognito Lambda triggers allow developers to run custom logic in response to specific lifecycle events. The Post Authentication trigger is invoked after a user successfully signs in. A developer can write a Lambda function that receives user data from the event and makes an API call to the custom analytics service.

  4. 4

    A developer is writing an AWS Lambda function that will be part of a CI/CD pipeline. The function code has several external library dependencies listed in a requirements.txt file. The developer wants to ensure that the deployment package created by the pipeline includes these dependencies. The pipeline uses AWS CodeBuild for the build stage. What is the standard way to package the Lambda function with its dependencies in this scenario?

    Show answer details

    Correct answer: B

    The standard method for packaging a Lambda function with its dependencies is to install the dependencies into the root directory of the project alongside the function code. In an AWS CodeBuild environment, this is achieved by adding a command to the buildspec.yml file. For Python, pip install -r requirements.txt -t . installs the libraries listed in requirements.txt into the current directory (.). The subsequent build step would then create a zip archive of the entire directory, which becomes the deployment package.

  5. 5

    An application is experiencing intermittent performance issues. A developer suspects that a downstream microservice, called via an HTTP API, is the source of the latency. To confirm this, the developer wants to trace the entire lifecycle of a request as it flows through the application's components, including the call to the external microservice. The application is deployed on Amazon EC2 instances. Which service should the developer use to get a detailed visualization of the request flow and identify performance bottlenecks?

    Show answer details

    Correct answer: B

    AWS X-Ray is a distributed tracing service that helps developers analyze and debug production, distributed applications. It provides an end-to-end view of requests as they travel through an application, showing a map of the application's underlying components. By instrumenting the application with the X-Ray SDK, the developer can generate trace data, view a service map to identify bottlenecks, and drill down into specific traces to see the latency of each downstream call.

  6. 6

    A developer is implementing envelope encryption to protect sensitive data before storing it in a database. The application must use AWS Key Management Service (AWS KMS) for key management. The developer needs to understand the correct sequence of API calls to perform this operation.

    Arrange the following steps in the correct order to implement envelope encryption.

    Show answer details

    Correct answer: A

    The correct sequence for envelope encryption is: 1. Request a data key from KMS. The GenerateDataKey operation returns both a plaintext version of the key and a version encrypted under the specified KMS Customer Master Key (CMK). 2. Use the plaintext key to perform encryption locally within your application. 3. Store the resulting ciphertext along with the encrypted data key. You need the encrypted data key to decrypt the data later. 4. Erase the plaintext data key from memory as soon as possible to minimize its exposure.

  7. 7

    A developer has written an AWS CloudFormation template to provision a serverless application consisting of an AWS Lambda function, an Amazon API Gateway, and an Amazon DynamoDB table. The developer wants to use the AWS Serverless Application Model (SAM) CLI to test the Lambda function locally before deploying it. Which SAM CLI command should the developer use to invoke the function locally with a test event?

    Show answer details

    Correct answer: C

    The sam local invoke command allows a developer to run a single invocation of a Lambda function locally. It runs the function code in a Docker container that simulates the Lambda runtime environment. The developer can pass an event payload to the function using the -e or --event flag, making it ideal for unit and integration testing before deployment.

  8. 8

    A developer is building a serverless application that uses an AWS Lambda function to process images uploaded to an Amazon S3 bucket. The function is written in Python and uses the Boto3 library. During testing, the developer notices that the function works correctly for small images but fails with a timeout error for larger images (over 100 MB). The current Lambda configuration has a memory of 128 MB and a timeout of 15 seconds. What is the MOST effective first step to resolve the timeout issue while adhering to the principle of least privilege for resource allocation?

    Show answer details

    Correct answer: B

    In AWS Lambda, CPU power is allocated proportionally to the amount of memory configured. Image processing is a CPU-intensive task. By increasing the memory, the developer also increases the available vCPU, which will speed up the processing of larger images and likely resolve the timeout issue. This is more effective than just increasing the timeout, as it addresses the root cause of the slow performance. AWS Lambda Power Tuning is a tool that can help find the optimal memory setting.

  9. 9

    A developer is creating a CI/CD pipeline using AWS CodePipeline for a serverless application defined in an AWS SAM template. The pipeline needs to deploy to a staging environment for testing and then, after manual approval, deploy to a production environment. The application uses an Amazon API Gateway and an AWS Lambda function. How should the developer configure the pipeline to manage the different API Gateway endpoints for staging and production?

    Show answer details

    Correct answer: B

    The best practice is to use a single Infrastructure as Code (IaC) template and manage environment-specific configurations separately. AWS CodePipeline's AWS CloudFormation deploy action allows specifying a parameter override file. The developer can create staging-params.json and production-params.json files to define stage-specific variables (like Lambda function names, memory sizes, or environment variables) and reference them in the respective deployment stages of the pipeline.

  10. 10

    A developer is writing an application that runs on an Amazon EC2 instance. The application needs to make calls to the Amazon DynamoDB API. According to security best practices, the developer must not store AWS credentials in the application code or configuration files. What is the MOST secure and recommended way for the application to obtain AWS credentials?

    Show answer details

    Correct answer: C

    Using IAM roles for EC2 instances is the most secure and recommended method. The application running on the EC2 instance can automatically retrieve temporary credentials from the EC2 metadata service. The AWS SDKs are designed to automatically look for these credentials. This avoids the need to store any long-term credentials on the instance, simplifying credential management and enhancing security.

Create an account to continue.