AWS Certified Developer - Associate Free Sample Questions

20 free sample questions212 in the full practice test Other version: DVA-C01(350)

Try simulator

DVA-C02 Sample Questions

  1. Question 1

    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?

    Answer and explanation

    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.

  2. Question 2

    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?

    Answer and explanation

    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.

  3. Question 3

    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?

    Answer and explanation

    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.

  4. Question 4

    Multiple answers

    A developer needs to design a system that processes a continuous stream of clickstream data. The system must be able to handle unpredictable traffic spikes and process events in near real-time. A key requirement is that the order of events for each user session must be strictly maintained. Which combination of AWS services should be used to meet these requirements? (Select TWO)

    Answer and explanation

    Correct answers: B, C

    Amazon Kinesis Data Streams is designed for real-time processing of streaming data at scale. To maintain the order of events for each user session, the developer can use the user's session ID as the partition key. All events with the same partition key will be sent to the same shard, ensuring in-order processing within that shard.

    AWS Lambda integrates natively with Kinesis Data Streams. It can be configured as a consumer to process records from the stream in micro-batches. Lambda scales automatically with the number of shards and the volume of data, making it ideal for handling traffic spikes without manual intervention.

  5. Question 5

    A developer has deployed a REST API using Amazon API Gateway, which is integrated with an AWS Lambda function. The API is publicly accessible. The developer wants to prevent abuse by limiting the number of requests a client can make to the API. Specifically, each client should be limited to 10 requests per second with a burst capacity of 20 requests. How can the developer implement this requirement?

    Answer and explanation

    Correct answer: B

    Amazon API Gateway usage plans are the standard way to manage throttling and quotas for your APIs. A developer can create a usage plan, define the rate (requests per second) and burst limits, and then associate this plan with one or more API stages. If the API requires client-specific keys, the plan can be associated with API keys.

  6. Question 6

    True or False: When using an Amazon SQS FIFO (First-In-First-Out) queue as a trigger for an AWS Lambda function, if the function fails to process a batch of messages, the entire batch becomes visible again for reprocessing after the visibility timeout expires, and the order of messages within that batch is preserved for the next processing attempt.

    Answer and explanation

    Correct answer: A

    This statement is true. For SQS FIFO queues, if a Lambda function invocation returns an error without successfully processing any messages in the batch, all messages in that batch remain in the queue and become visible again after the visibility timeout. The Lambda service ensures that it will attempt to process the same batch of messages again while preserving their original order relative to other messages in the same message group.

  7. Question 7

    A developer is writing a Python script using Boto3 to list all objects in a versioned Amazon S3 bucket that contains over 1 million objects. The initial script uses the s3_client.list_objects_v2() method in a simple loop. During testing, the script is very slow and occasionally misses some objects. To improve performance and ensure all objects are retrieved, the developer decides to use a higher-level abstraction provided by Boto3. Which Boto3 feature should the developer use?

    Answer and explanation

    Correct answer: C

    Many AWS API operations that return a list of items are paginated. Manually handling the pagination tokens (NextToken, NextContinuationToken, etc.) is error-prone. Boto3 Paginators provide a higher-level abstraction that automatically handles the logic of making multiple service calls to retrieve all results. For listing objects, get_paginator('list_object_versions') should be used for a versioned bucket.

  8. Question 8

    Multiple answers

    A developer is instrumenting a Node.js application running on AWS Fargate to use AWS X-Ray for distributed tracing. The application makes calls to an Amazon DynamoDB table and publishes messages to an Amazon SNS topic. The developer has already configured the X-Ray daemon to run as a sidecar container in the Amazon ECS task definition.

    Which steps must the developer take within the application code to ensure that calls to DynamoDB and SNS are automatically traced as subsegments? (Select TWO)

    Answer and explanation

    Correct answers: A, B

    The core X-Ray SDK library is required to create segments, subsegments, and interact with the X-Ray daemon. This is the foundational step for any X-Ray instrumentation in a Node.js application.

    To automatically trace downstream calls made with the AWS SDK, the SDK itself must be instrumented. The AWS X-Ray SDK for Node.js provides a captureAWS method that patches the AWS SDK to automatically create subsegments for each API call, including calls to DynamoDB and SNS.

  9. Question 9

    A developer needs to store customer session data for a high-traffic e-commerce application running on Amazon EC2. The session data must be highly available and provide low-latency read and write access. The data also needs to expire automatically 24 hours after creation to keep the data store clean. Which service is the BEST choice for this use case?

    Answer and explanation

    Correct answer: D

    Amazon ElastiCache for Redis is an in-memory data store that provides sub-millisecond latency for reads and writes, making it perfect for session management in high-traffic applications. Redis has built-in support for setting a time-to-live (TTL) on keys, which will automatically expire and evict the session data after the specified duration. This meets all the requirements with high performance and minimal management.

  10. Question 10

    A developer is building an application that will be deployed using a blue/green strategy on AWS Lambda. The developer is using AWS CodeDeploy to manage the traffic shifting between the old and new versions of a Lambda function. The developer needs to define the deployment steps in an appspec.yml file. The deployment should shift 10% of traffic to the new version, wait 5 minutes, and then shift the remaining 90% of traffic. Which AWS CodeDeploy deployment type should be specified in the AppSpec file?

    Answer and explanation

    Correct answer: B

    The scenario describes a canary deployment, which is a type of linear deployment in AWS CodeDeploy. The Linear deployment type allows traffic to be shifted in increments with a specified interval between them. The developer would configure Type: Linear, StepPercentage: 10, and Interval: 5 (in minutes) to achieve the initial 10% shift. The Canary deployment type is a predefined linear deployment that shifts traffic in two increments.

Register free to unlock 10 more sample questions

Lifetime One

Own this practice test forever.

$79.99
$75.99
one-time
  • Full access to 562 questions
  • Study, Timed & Flashcard Modes
  • All past and future versions i
  • Detailed Explanations
  • Study Tracking & Past Attempts
  • Brainy AI Assistant
  • Lifetime updates

Two

Any 2 exams per month.

$20.00/exam
$39.99
/month
  • 2 active exam slots
  • Study, Timed & Flashcard Modes
  • All past and future versions i
  • Detailed Explanations
  • Study Tracking & Past Attempts
  • 1,000 Brainy AI Credits
  • Cancel anytime

Premium Twelve

Any 12 exams over 3 months.

$15.00/exam
$179.99
/3 months
  • 4 active exam slots
  • Study, Timed & Flashcard Modes
  • All past and future versions i
  • Detailed Explanations
  • Study Tracking & Past Attempts
  • 15,000 Brainy AI Credits
  • Dedicated support
  • Friend seat included — full access

Trusted by professionals at

NvidiaSupabaseGitHubOpenAITursoClerkClaude AIAmazon