AWS Certified Developer - Associate (DVA-C02) · AWS

Development with AWS Services

12 practice questions covering 32% of the official AWS Certified Developer - Associate (DVA-C02) blueprint. Every item includes a worked explanation of the correct answer.

View all 4 domains in AWS Certified Developer - Associate (DVA-C02)

Syllabus Coverage & Domain Overview

Development with AWS Services is the largest domain of the DVA-C02 exam, at 32 percent of scored content. The official outline splits it into three tasks: writing application code for AWS, writing code for AWS Lambda, and using data stores in application development. It is about building working software on AWS services, not about operating infrastructure.

The first task is architectural and coding fundamentals. You should be able to tell event-driven designs from microservice and monolithic ones, choreography from orchestration, stateful from stateless, tight coupling from loose coupling, and synchronous from asynchronous calls. You also need to write resilient code, with retries, circuit breakers and sensible error handling around third-party integrations. The outline adds building and maintaining APIs (request and response transformation, validation rules, overriding status codes), unit testing with AWS SAM, messaging services, SDK calls, streaming data, Amazon EventBridge patterns, and Amazon Q Developer as a development aid.

The second task is Lambda. Expect to configure functions through memory, timeout, runtime, handler, environment variables, layers, extensions, triggers, concurrency and destinations. You also need to know how a function reaches private resources inside a VPC, how failed events are handled with destinations and dead-letter queues, and how to tune performance and process data in near real time. A useful distinction is between synchronous and asynchronous invocation, and between event sources that Lambda polls and those that push to it, because retry and failure behavior differs in each case.

The third task is data. The core is DynamoDB: choosing partition keys with high cardinality so access is balanced, defining keys and indexes, and knowing when to use query rather than scan. You must also understand strongly consistent versus eventually consistent reads, serialization and deserialization for persistence, data lifecycle management, caching services, and choosing a specialized store such as Amazon OpenSearch Service when the access pattern calls for it.

Questions are usually short scenarios that describe a symptom or a requirement and ask for the most suitable change, often with several plausible answers. Common traps are picking a service that works but adds unnecessary operational effort, confusing orchestration with choreography, overlooking that a scan is wasteful when a key-based query would do, and treating a consistency or concurrency setting as a fix for a problem it does not address. Read for the constraint that decides the answer, such as latency, ordering, cost, or the least code change.

To prepare, work through each skill in the official outline and build a small example for it. Write a Lambda function triggered by a queue, add a destination for failures, model a DynamoDB table with a secondary index, and run the code locally with SAM. Then read the SDK and service documentation for the settings you touched, and practice scenario questions, explaining to yourself why each wrong option fails.

In the official AWS Certified Developer - Associate (DVA-C02) examination blueprint, Development with AWS Services carries a weightage of 32%. Out of the total examination duration of 2 hr 10 min, candidates should budget approximately 42 min for questions from this domain to maintain pace across the paper.

How to Master Development with AWS Services for AWS Certified Developer - Associate (DVA-C02)

Our 12 published questions in Development with AWS Services are written for PrepIQ Hub and checked as set out in our editorial policy. Each item is written to the medium difficulty level of the AWS exam:

  • Targeted Topic Drills: Launch Topic Practice mode to work exclusively through Development with AWS Services items and review the step-by-step derivation after each submission.
  • Negative Marking Discipline: The AWS Certified Developer - Associate (DVA-C02) applies no negative marking penalty, so practice eliminating the three distractors systematically on every Development with AWS Services item.
  • Benchmark Target: Aim for at least 72% accuracy in Development with AWS Services drills before moving to full-paper simulations.

Development with AWS Services worked examples

Development with AWS Services questions from the AWS Certified Developer - Associate (DVA-C02) syllabus, answered in full. Try each one before opening the explanation.

  1. Example 1 · Development with AWS Services · medium

    An Amazon API Gateway REST API fronts a legacy product-catalog backend that takes 800 ms per query. Because 90% of incoming GET /products/{categoryId} requests query the same 50 popular categories, the developer enables API Gateway Stage Caching with a TTL of 300 seconds. During a flash sale, an administrator updates the price of an item in categoryId = 42 and needs to force a single immediate cache refresh (invalidation) for that specific request without flushing the entire stage cache. How does API Gateway support per-request cache invalidation?

    • ADelete and recreate the entire API Gateway REST API and custom domain
    • BSend an HTTP DELETE request to the AWS X-Ray trace collector daemon
    • CSend the request with the Cache-Control: max-age=0 header (InvalidateCache)
    • DChange the backend Lambda function runtime from nodejs20.x to python3.12 in SAM
    Show answer and explanation

    Correct answer: C. Send the request with the Cache-Control: max-age=0 header (InvalidateCache)

    Why

    API Gateway REST API stage caching lets a client invalidate a single cache entry by sending the request with the header Cache-Control: max-age=0. The gateway then skips the cached response, calls the backend, and stores the fresh result under the same cache key, so only that entry (here, the request for categoryId 42) is refreshed and the rest of the stage cache stays intact. This is controlled by the stage cache setting that requires authorization for cache invalidation. By default the caller needs execute-api:InvalidateCache permission in an IAM policy, or the setting can be relaxed so unauthorized callers may invalidate, which is risky because anyone could force backend load. The common trap is confusing this with flushing the entire stage cache from the console or the FlushStageCache API call, which clears every entry and would send all 50 popular categories back to the slow 800 ms backend. The question asks for a per-request approach, which is the header.

    • A. Delete and recreate the entire API Gateway REST API and custom domain — Deleting and recreating the REST API and custom domain is a destructive redeployment that causes an outage and discards all configuration. It is not a cache invalidation mechanism and is far broader than a single-entry refresh.
    • B. Send an HTTP DELETE request to the AWS X-Ray trace collector daemon — The AWS X-Ray daemon collects and forwards trace segments for observability. It has no interface for sending DELETE requests to manage API Gateway stage cache entries, so it cannot invalidate anything.
    • D. Change the backend Lambda function runtime from nodejs20.x to python3.12 in SAM — Changing the Lambda runtime from Node.js to Python alters backend code execution, not the cache. Cached responses stay in API Gateway until the TTL expires or they are invalidated, so a runtime change would not refresh the cached price for categoryId 42.
  2. Example 2 · Development with AWS Services · medium

    A customer-facing checkout API built on AWS Lambda (Java 21 runtime) experiences a 3.2-second cold-start latency spike every morning at 09:00 when traffic jumps from 0 to 400 concurrent requests per second. The team requires guaranteed zero cold starts for up to 400 concurrent executions at 09:00, even if the function uses native C/JNI extensions that cannot use SnapStart. Which Lambda concurrency setting keeps 400 pre-initialized execution environments warm and ready to respond in single-digit milliseconds?

    • AReserved Concurrency set to 400 on the $LATEST version
    • BDecreasing the Lambda function's memory allocation from 2,048 MB to 128 MB
    • CConfiguring an SQS Dead-Letter Queue (DLQ) on the synchronous API Gateway call
    • DProvisioned Concurrency configured on a published Lambda version or alias
    Show answer and explanation

    Correct answer: D. Provisioned Concurrency configured on a published Lambda version or alias

    Why

    Provisioned Concurrency pre-initializes a requested number of Lambda execution environments (INIT phase completed ahead of time) so they stay warm and respond immediately without cold-start latency (and can be scheduled via Application Auto Scaling before the 09:00 spike). By contrast, Reserved Concurrency only caps/guarantees the maximum concurrency slice without pre-warming environments.

    • A. Reserved Concurrency set to 400 on the $LATEST version — Reserved Concurrency throttles concurrency above 400 and guarantees quota, but it does not pre-initialize warm environments to eliminate cold starts.
    • B. Decreasing the Lambda function's memory allocation from 2,048 MB to 128 MB — Reducing Lambda memory proportionally reduces CPU allocation, making cold starts even slower.
    • C. Configuring an SQS Dead-Letter Queue (DLQ) on the synchronous API Gateway call — DLQs capture failed asynchronous invocations and do not pre-warm synchronous Lambda execution environments.
  3. Example 3 · Development with AWS Services · hard

    An AWS Lambda function polls an Amazon SQS standard queue via an Event Source Mapping with a batch size of 10 messages. During one invocation, 8 messages are processed successfully, but 2 messages fail due to a transient downstream timeout. By default, if the Lambda function throws an unhandled exception, all 10 messages return to the queue and the 8 succeeded messages get reprocessed. Which two actions should the developer take so only the 2 failed messages are retried? (Select two.)

    • AEnable ReportBatchItemFailures on the Lambda SQS Event Source Mapping
    • BSet the SQS queue VisibilityTimeout to 0 seconds for every received message
    • CConvert the Lambda execution role into a Cognito User Pool token authorizer
    • DReturn a JSON payload listing failed itemIdentifier IDs in batchItemFailures
    Show answer and explanation

    Correct answers: A. Enable ReportBatchItemFailures on the Lambda SQS Event Source Mapping; D. Return a JSON payload listing failed itemIdentifier IDs in batchItemFailures

    Why

    To enable partial batch responses on an SQS-to-Lambda Event Source Mapping, you must enable ReportBatchItemFailures in the Event Source Mapping configuration (functionResponseTypes: ["ReportBatchItemFailures"]) (A) and have the Lambda handler return a JSON object listing the failed message IDs under batchItemFailures: [{ "itemIdentifier": "<msgId>" }] instead of throwing an unhandled error (D).

    • B. Set the SQS queue VisibilityTimeout to 0 seconds for every received message — Setting VisibilityTimeout to 0 makes messages immediately visible to other consumers while still executing, causing duplicate processing.
    • C. Convert the Lambda execution role into a Cognito User Pool token authorizer — Cognito User Pools authenticate end-user JWTs on API Gateway, not SQS batch retry semantics.
  4. Example 4 · Development with AWS Services · medium

    An order-fulfillment workflow coordinates 6 sequential and parallel steps: reserve inventory, charge credit card, handle payment retry/backoff on transient error, wait up to 48 hours for warehouse manager approval via a callback token (waitForTaskToken), and ship the package. Why is AWS Step Functions (Standard Workflow) preferred over chaining 6 AWS Lambda functions together via synchronous Invoke calls in code?

    • AIncrease a single AWS Lambda function's timeout to 48 hours using time.sleep(172800)
    • BStep Functions Standard Workflows support 1-year runs, waitForTaskToken, and Retry/Catch
    • CAmazon API Gateway WebSocket connections stay open for 48 hours without disconnects
    • DAmazon ElastiCache Memcached automatically orchestrates 48-hour payment retries
    Show answer and explanation

    Correct answer: B. Step Functions Standard Workflows support 1-year runs, waitForTaskToken, and Retry/Catch

    Why

    AWS Step Functions Standard Workflows provide built-in state management, declarative Retry and Catch error handling, visual audit history, and long-running execution durations up to 1 year (including .waitForTaskToken human approval callbacks without paying for idle Lambda compute), whereas a single Lambda execution is capped at 15 minutes.

    • A. Increase a single AWS Lambda function's timeout to 48 hours using time.sleep(172800) — AWS Lambda has a hard maximum execution timeout of 15 minutes (900 seconds), and sleeping inside Lambda bills for idle compute.
    • C. Amazon API Gateway WebSocket connections stay open for 48 hours without disconnects — API Gateway WebSocket connections have a maximum connection duration of 2 hours.
    • D. Amazon ElastiCache Memcached automatically orchestrates 48-hour payment retries — Memcached is a volatile key-value cache, not a durable workflow state machine.
  5. Example 5 · Development with AWS Services · medium

    Five different AWS Lambda functions written in Python 3.12 share the same 45 MB internal cryptography and data-validation library (corp_crypto_utils). Currently, every developer bundles a duplicate copy of the 45 MB library into each function's deployment .zip package, slowing down deployments and making library version updates tedious. Which AWS Lambda feature allows packaging shared libraries once and mounting them into /opt across multiple functions?

    • ALambda Ephemeral Storage (/tmp) shared across functions
    • BAWS Lambda Layers mounted into the /opt directory of each function
    • CAmazon API Gateway Mapping Templates written in Apache Velocity (VTL)
    • DAWS Step Functions Express Workflow state payloads (256 KB maximum)
    Show answer and explanation

    Correct answer: B. AWS Lambda Layers mounted into the /opt directory of each function

    Why

    Lambda Layers are the feature built for this scenario. A layer is a versioned .zip archive that holds libraries, a custom runtime, or configuration files. You publish it once, and any number of functions can reference its ARN. At cold start Lambda extracts the layer contents into the /opt directory of the execution environment. For Python, packages placed under a python/ folder in the layer are added to the import path, so the functions can import corp_crypto_utils with no code changes. Each function can use up to five layers, and the unzipped size of the function code plus all its layers must stay within 250 MB. Because layer versions are immutable, you update the library by publishing a new version and pointing each function at it. The common trap is to think of /tmp as shared storage. It is not, and it is the wrong place to deliver code dependencies.

    • A. Lambda Ephemeral Storage (/tmp) shared across functions — Ephemeral storage at /tmp is scratch space attached to a single execution environment. It is not shared between functions, and it does not persist or distribute packaged code. It cannot hold a shared library for five separate functions.
    • C. Amazon API Gateway Mapping Templates written in Apache Velocity (VTL) — API Gateway mapping templates use Apache Velocity Template Language (VTL) to transform request and response payloads at the API layer. They have nothing to do with packaging or distributing Python dependencies to Lambda runtimes.
    • D. AWS Step Functions Express Workflow state payloads (256 KB maximum) — Step Functions Express Workflows orchestrate state machines, and their state payloads are limited to 256 KB. They do not mount code into Lambda functions, and a 45 MB library could not fit in a payload anyway.
  6. Example 6 · Development with AWS Services · medium

    A photo-sharing platform stores private user photos in an Amazon S3 bucket (Block Public Access = ON). When an authenticated user clicks 'Upload Avatar (15 MB)' or 'Download Invoice PDF' in the browser, the backend AWS Lambda function should not proxy the 15 MB binary payload through API Gateway (10 MB payload limit). Instead, what should the Lambda function generate and return to the browser so the client can upload or download the object directly to/from Amazon S3 for the next 15 minutes?

    • AMake the S3 bucket public (Principal: "*") for 15 minutes during each PutObject upload
    • BBase64-encode the 15 MB file and pass it through a synchronous API Gateway POST payload
    • CAn Amazon S3 Presigned URL (putObject / getObject) with a 15-minute expiry
    • DAn Amazon DynamoDB Time-to-Live (TTL) epoch attribute on the S3 BucketPolicy resource
    Show answer and explanation

    Correct answer: C. An Amazon S3 Presigned URL (putObject / getObject) with a 15-minute expiry

    Why

    Generating an Amazon S3 Presigned URL (generate_presigned_url / getSignedUrl for putObject or getObject with an expiration like ExpiresIn=900 seconds) grants temporary, time-bounded permission (inheriting the signing IAM role's permissions) for the client browser to upload or download directly to/from S3 while bypassing API Gateway's 10 MB payload limit.

    • A. Make the S3 bucket public (Principal: "*") for 15 minutes during each PutObject upload — Opening the bucket to the public exposes every user's private files.
    • B. Base64-encode the 15 MB file and pass it through a synchronous API Gateway POST payload — API Gateway has a hard 10 MB maximum payload limit, so a 15 MB payload will fail with 413 Payload Too Large.
    • D. An Amazon DynamoDB Time-to-Live (TTL) epoch attribute on the S3 BucketPolicy resource — DynamoDB TTL expires table items, not temporary S3 object upload URLs.
  7. Example 7 · Development with AWS Services · medium

    A web application hosted on https://app.example.com makes an XMLHttpRequest / fetch() POST call (with a custom Authorization: Bearer <jwt> header) directly from the user's browser to an Amazon API Gateway REST API hosted at https://api.example.org. The browser blocks the request with: Access to fetch at 'https://api.example.org' from origin 'https://app.example.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check. What must be configured on API Gateway to resolve this?

    • AEnable CORS on API Gateway to handle OPTIONS preflight and return Access-Control-Allow-*
    • BPlace the API Gateway inside a Private VPC Subnet with EndpointConfiguration: PRIVATE only
    • CEnable AWS X-Ray active tracing on the API Gateway stage via tracingEnabled: true in SAM
    • DIncrease the API Gateway integration timeout from 29000 ms to 900000 ms on the POST route
    Show answer and explanation

    Correct answer: A. Enable CORS on API Gateway to handle OPTIONS preflight and return Access-Control-Allow-*

    Why

    When a browser sends a cross-origin request with a custom header (Authorization) or non-simple method, it first sends an HTTP OPTIONS preflight request. Enabling CORS (Cross-Origin Resource Sharing) on the API Gateway resource configures an OPTIONS method (and adds Access-Control-Allow-Origin, Access-Control-Allow-Headers, and Access-Control-Allow-Methods headers to both the preflight and actual responses).

    • B. Place the API Gateway inside a Private VPC Subnet with EndpointConfiguration: PRIVATE only — Making the API private prevents public browser clients from reaching it altogether.
    • C. Enable AWS X-Ray active tracing on the API Gateway stage via tracingEnabled: true in SAM — X-Ray tracing records performance spans and does not emit browser CORS headers.
    • D. Increase the API Gateway integration timeout from 29000 ms to 900000 ms on the POST route — API Gateway has a hard 29-second regional integration limit (unless using specific quota increases), and timeouts do not cause CORS preflight blocks.
  8. Example 8 · Development with AWS Services · medium

    A financial ledger uses Amazon SQS FIFO (First-In-First-Out) queues (orders.fifo) to guarantee strict message ordering and exactly-once processing within a 5-minute window. Multiple producer microservices publish order events for thousands of different customers (CustomerId). If every producer sets the exact same static MessageGroupId = "ALL_ORDERS" on every message, what performance bottleneck occurs, and how should MessageGroupId be designed instead?

    • AThe FIFO queue automatically converts itself into an Amazon SNS standard topic
    • BMessages serialize into one stream; set MessageGroupId = CustomerId for parallelism
    • CMessages sharing the same MessageGroupId are immediately dropped as duplicates
    • DSQS FIFO deletes messages older than 60 seconds when MessageGroupId = "ALL_ORDERS"
    Show answer and explanation

    Correct answer: B. Messages serialize into one stream; set MessageGroupId = CustomerId for parallelism

    Why

    In an Amazon SQS FIFO queue, MessageGroupId defines the boundary for strict ordering: SQS processes messages within the same MessageGroupId one batch/consumer at a time so order is preserved. Setting a single static MessageGroupId serializes the entire queue to a single active consumer stream. Setting MessageGroupId = CustomerId (high cardinality) preserves strict ordering per customer while allowing thousands of different customers' orders to be processed in parallel.

    • A. The FIFO queue automatically converts itself into an Amazon SNS standard topic — SQS FIFO queues never convert themselves into SNS topics.
    • C. Messages sharing the same MessageGroupId are immediately dropped as duplicates — MessageDeduplicationId (not MessageGroupId) controls 5-minute duplicate suppression.
    • D. SQS FIFO deletes messages older than 60 seconds when MessageGroupId = "ALL_ORDERS" — SQS retains messages up to the configured MessageRetentionPeriod (4 days default, up to 14 days).
  9. Example 9 · Development with AWS Services · hard

    A developer is designing indexes for an Amazon DynamoDB Orders table whose base primary key is CustomerId (Partition Key) and OrderDate (Sort Key). Which two statements accurately compare a Local Secondary Index (LSI) and a Global Secondary Index (GSI) in DynamoDB? (Select two.)

    • AAn LSI shares the base Partition Key, is created at table creation, and supports strong reads
    • BAn LSI can be added to an existing table anytime and uses a different PK
    • CA GSI can use a different Partition Key, be added anytime, and supports eventual reads only
    • DA GSI supports strongly consistent GetItem reads and shares the base table's provisioned WCU quota
    Show answer and explanation

    Correct answers: A. An LSI shares the base Partition Key, is created at table creation, and supports strong reads; C. A GSI can use a different Partition Key, be added anytime, and supports eventual reads only

    Why

    In Amazon DynamoDB: (B) an LSI shares the same Partition Key as the base table (CustomerId) with a different Sort Key, must be created when the table is created, and supports both strongly consistent and eventually consistent reads (A); (C) a GSI can define a completely different Partition Key and Sort Key, can be added or deleted at any time on an existing table, and supports only eventually consistent reads with its own separate RCU/WCU throughput (C).

    • B. An LSI can be added to an existing table anytime and uses a different PK — Only a GSI can be added to an existing table or use a different Partition Key; LSIs are fixed at table creation.
    • D. A GSI supports strongly consistent GetItem reads and shares the base table's provisioned WCU quota — GSIs support only eventually consistent Query/Scan reads and maintain their own independent RCU/WCU capacity.
  10. Example 10 · Development with AWS Services · medium

    The same Amazon DynamoDB table receives 50 standard writes per second of items that are 2.5 KB each, and 15 transactional writes (TransactWriteItems) per second of items that are 1.8 KB each. How many total Write Capacity Units (WCUs) must be provisioned?

    • A180 WCUs (forgetting to double the WCU cost for transactional writes)
    • B152 WCUs (multiplying unrounded fractional kilobytes directly)
    • C210 WCUs (150 WCUs for standard writes plus 60 WCUs for transactions)
    • D360 WCUs (doubling both standard and transactional write operations)
    Show answer and explanation

    Correct answer: C. 210 WCUs (150 WCUs for standard writes plus 60 WCUs for transactions)

    Why

    1 WCU supports 1 standard write per second for an item up to 1 KB, whereas transactional writes require 2 WCUs per 1 KB. Each item size is rounded up to the next whole 1 KB: - 50 standard writes of 2.5 KB ($\lceil 2.5 \rceil = 3\text{ KB}$): $50 \times 3 = 150\text{ WCUs}$ - 15 transactional writes of 1.8 KB ($\lceil 1.8 \rceil = 2\text{ KB}$, doubled for transactions): $15 \times 2 \times 2 = 60\text{ WCUs}$ - Total WCUs: $150 + 60 = \mathbf{210\text{ WCUs}}$.

    • A. 180 WCUs (forgetting to double the WCU cost for transactional writes) — TransactWriteItems requires 2x the WCUs of standard writes (15 * 2 * 2 = 60 WCUs, not 30 WCUs).
    • B. 152 WCUs (multiplying unrounded fractional kilobytes directly) — DynamoDB rounds every write item up to the next whole 1 KB boundary (ceil(2.5) = 3 and ceil(1.8) = 2).
    • D. 360 WCUs (doubling both standard and transactional write operations) — Only transactional writes consume 2 WCUs per 1 KB; standard PutItem calls consume 1 WCU per 1 KB.

Every worked example on this page passed our independent verification before publication — how that works is set out in our editorial policy. Spotted an error? Tell us through the contact page and we will correct it.

All 12 Development with AWS Services questions with answers

All Syllabus Domains in AWS Certified Developer - Associate (DVA-C02)

AWS and Amazon Web Services are trademarks of Amazon.com, Inc. PrepIQ Hub is not affiliated with, endorsed by, or sponsored by Amazon Web Services.