AWS
AWS Certified Developer - Associate (DVA-C02)
47 published questions across 4 topics. Every answer carries a worked explanation, and the results screen shows your accuracy topic by topic.
Last updated · questions are checked before publication — how we verify them
Or launch active-recall flashcards to revise key concepts and formulas. Nothing here needs an account.
The paper
47 questions, banded by topic in the proportions the paper uses.
What the paper covers
Development with AWS Services
12 questions32%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.
Topic study guide · Practice Development with AWS Services (12 questions) →
Security
12 questions26%Security is the largest-weighted area after development with AWS services, at 26 percent of the DVA-C02 scored content. The official outline splits it into three tasks: implementing authentication and authorization for applications and AWS services, implementing encryption with AWS services, and managing sensitive data in application code. The emphasis throughout is on what a developer builds into an application, not on how an administrator runs an account. The first task covers federated access through identity providers, bearer tokens, programmatic access, assuming IAM roles, defining IAM permissions, fine-grained authorization inside the application, and authentication between services in a microservices design. The distinctions that matter are between a user directory that signs people in and issues tokens, and a mechanism that exchanges an identity for temporary AWS credentials. You also need to know when a role is assumed instead of a long-lived key being used, how cross-account access depends on both a trust policy and a permissions policy, and how a permissions boundary or similar guardrail limits what a developer-created role can ever do. Applications running on AWS compute should get credentials from a role, never from keys stored in code or configuration. The second task covers encryption at rest and in transit, certificate management (the outline names AWS Private CA as an example), client-side versus server-side encryption, using and rotating keys, and cross-account encryption. Be clear on who holds the key and who performs the encryption in each option. Know how envelope encryption works, why a data key is used for large payloads instead of sending the payload to the key service, and how key policies and grants decide which principals, including those in another account, may use a key. Server-side options with service-managed keys, customer managed keys and customer-supplied keys differ in control, auditability and operational burden. The third task covers classifying data such as personal and health information, encrypting environment variables, using secret management services, and sanitizing or masking sensitive data. The usual comparison is between a dedicated secrets service with built-in rotation and a general-purpose parameter store, and the choice often turns on rotation requirements, cost and the type of secret. Questions are usually short scenarios with a stated compliance or operational requirement, such as no long-lived credentials, automatic rotation, an audit trail for every use of a key, or access from another account. Several options will often work technically, and the right answer is the one that meets every stated constraint with the least custom code. Common traps include granting broad permissions where least privilege is asked for, forgetting that cross-account access needs permission on both sides, confusing authentication with authorization, and picking a manual approach where a managed feature already does the job. Watch for answers that put secrets in code, in plain environment variables or in logs. To prepare, work through each task in a real account. Create a role and assume it from another account, set up a user directory and trace the tokens it issues, encrypt an object under a customer managed key and read the key policy, and rotate a database secret. Then read the official exam guide task by task and make sure you can explain each named skill in your own words.
Deployment
11 questions24%The Deployment domain of the current DVA-C02 guide is about getting application code from a developer's machine into running AWS environments in a repeatable, testable way. The official outline splits it into four tasks: preparing application artifacts, testing applications in development environments, automating deployment testing, and deploying code through AWS continuous integration and delivery services. It is a hands-on domain, so expect to be judged on what you would actually configure rather than on definitions. Preparing artifacts means knowing what goes inside a deployable package: dependencies, configuration files, environment variables and container images, plus a sensible directory layout and the memory and compute a function or service needs. Environment-specific configuration, including the use of AWS AppConfig, belongs here too. The testing tasks cover writing integration tests with mocked external APIs, building test events such as JSON payloads for Lambda and API Gateway, using API Gateway stages as development endpoints, and keeping approved versions available for testing through Lambda aliases, image tags or branch-based environments. Infrastructure as code runs through the whole domain, with AWS SAM and CloudFormation templates being written, updated and deployed to different environments. The CI/CD task is the heaviest. You should be able to explain Lambda packaging options, API Gateway stages and custom domains, and how a commit to a repository triggers build, test and deploy actions. You also need to separate the roles of the services involved: a pipeline orchestrates, a build service compiles and tests using its build specification, and a deployment service releases using its own specification file and lifecycle hooks. Deployment strategies are central. Be clear on the differences between blue/green, canary, linear, rolling and all-at-once releases, what each costs in capacity and risk, and how each one is rolled back. The outline also mentions labels and branches for release management and using stage variables to drive dynamic behavior. Questions are usually short scenarios with a constraint attached, such as minimal downtime, a gradual shift of traffic, a quick rollback, or keeping the same version across environments. Common traps include picking a strategy that replaces capacity in place when the scenario demands an untouched previous version, mixing up which file or service does what, and ignoring where the failure appears, for example a build failing versus a hook failing during deployment. Another trap is choosing a manual or console answer when the question clearly wants a template-driven, repeatable one. Read each option for the exact deployment platform, since EC2, Lambda and container targets behave differently. For preparation, build a small SAM application and push it through a pipeline with a build step and a gradual Lambda deployment, then deliberately break a build, a hook and a template update and read the errors. Practise rollbacks, deploy the same template to two stages, and write one mocked integration test. Reading the official outline skill by skill and checking you can do each one is a reliable checklist.
Troubleshooting and Optimization
12 questions18%This domain is about finding out why an application misbehaves and then making it faster and cheaper to run. The current exam guide splits it into three tasks: helping with root cause analysis, instrumenting code so that it can be observed, and optimizing applications with AWS services and features. It is worth 18 percent of the scored content, so it is a substantial share of the exam. On the diagnosis side, you are expected to read application metrics, logs and traces and connect them to a defect, a failed deployment or a broken integration between services. That means querying logs for the relevant events, using dashboards and insights to judge health, and reading the output logs from a deployment service to see where a release failed. On the instrumentation side, the guide expects you to tell logging, monitoring and observability apart, and to write code that produces useful signals. Examples are structured log entries for application events and user actions, custom metrics such as those emitted through the CloudWatch embedded metric format, trace annotations, health checks and readiness probes, and notifications for events like approaching quota limits or a finished deployment. The optimization task covers concurrency, profiling, and working out the minimum memory and compute an application needs. It also covers filter policies on message subscriptions so that consumers receive only what they need, caching based on request headers, caching inside the application, and using logs to locate bottlenecks. The distinctions to hold on to are these. A metric tells you that something changed, a log tells you what happened, and a trace tells you where in a chain of services the time or the error occurred. Searchable trace data differs from extra context that is only stored with it. Edge caching keyed on headers differs from a cache that sits next to your data store. Increasing memory for a function also changes its CPU share, so the cheapest setting is not always the smallest. Questions usually describe a symptom, such as slow responses, intermittent errors, duplicate processing, a throttled function or a database that is overwhelmed, and ask which change or tool resolves it with the least effort. The common traps are choosing a heavier service when a built-in feature would do, confusing a logging fix with a tracing fix, picking a metric when the scenario needs a trace to find the failing hop, and caching data that must always be current. Read for the exact requirement, such as whether the goal is lower latency, lower cost, fewer messages delivered, or faster diagnosis. To prepare, work through each skill in the official outline and make sure you can do it in the console and in code. Turn on tracing for a small multi-service application, add an annotation, emit a custom metric, and run a log query against structured entries. Then change a function's memory and compare its duration and cost, add a cache, and add a filter policy to a subscription. Practicing with a real failure in front of you teaches the symptom-to-fix mapping that the questions test.
Topic study guide · Practice Troubleshooting and Optimization (12 questions) →
Examination Pattern, Scoring & Preparation Strategy
The AWS Certified Developer - Associate (DVA-C02) is administered by AWS within the Cloud & IT Certification track. A standard full-length sitting consists of 65 questions over a duration of 2 hr 10 min at a medium difficulty level. Because there is no negative marking penalty for wrong answers, candidates should eliminate implausible distractors and ensure every item is answered before time expires.
To maximize your score on the AWS Certified Developer - Associate (DVA-C02), start with the five-question diagnostic drill to benchmark your baseline across all 4 blueprint domains. Next, focus your study blocks on the highest-weighted topics above — where every answer on PrepIQ Hub includes a worked explanation of the keyed solution. You can read how questions are written and checked in our Editorial Policy.
AWS Certified Developer - Associate (DVA-C02) worked examples
Sample AWS Certified Developer - Associate (DVA-C02) questions answered in full: try each one, then open the explanation to see why the keyed answer is right and where each distractor goes wrong.
Example 1 · Troubleshooting and Optimization · easy
A backend application uses Amazon ElastiCache for Redis in front of an Amazon RDS PostgreSQL database. Whenever the application requests a user profile, it checks Redis first; on a cache miss, the application queries RDS, writes the returned row into Redis with a TTL (Time to Live) of 300 seconds, and returns the profile. What is this caching pattern called, and what is its main trade-off compared to Write-Through caching?
Show answer and explanation
Correct answer: C. Lazy Loading (Cache-Aside); it caches requested items with a cache-miss penalty
Why
Checking the cache first and populating it from the database only on a cache miss is Lazy Loading (Cache-Aside). Its advantage is that only requested data is cached (avoiding cache pollution), while its trade-offs are a cache-miss latency penalty on the first read and potential stale data until TTL expiration unless paired with write-through or invalidation.
- A. Write-Through caching; it guarantees zero cache misses on initial cold start — The described flow populates the cache on a read miss (Lazy Loading), not on every database write (Write-Through).
- B. DynamoDB Accelerator (DAX) write-sharding; it only works with NoSQL key-value stores — DAX is exclusively for Amazon DynamoDB, whereas this architecture uses ElastiCache for Redis in front of RDS PostgreSQL.
- D. CloudFront Origin Shield; it caches TCP database connections at DNS edge locations — CloudFront caches HTTP/HTTPS responses at CDN edge locations, not Redis key-value rows.
Example 2 · Troubleshooting and Optimization · medium
Hundreds of short-lived AWS Lambda functions concurrently open and close new TCP database connections to an Amazon RDS for PostgreSQL instance during traffic bursts, exhausting the database's max_connections memory limit and causing Too many connections errors. Which fully managed AWS service sits between Lambda and Amazon RDS to pool and share warm database connections while speeding up Multi-AZ failover times?
Show answer and explanation
Correct answer: B. Amazon RDS Proxy managing a shared pool of warm database connections
Why
Amazon RDS Proxy is the fully managed service designed for this exact problem. Each Lambda execution environment normally opens its own database connection, so a burst of hundreds of concurrent invocations can exceed max_connections on the RDS for PostgreSQL instance and produce Too many connections errors. RDS Proxy sits between the function and the database, keeps a pool of established connections, and multiplexes many client connections onto a smaller number of database connections, which protects database memory and CPU. It also shortens Multi-AZ failover impact, because the proxy keeps client connections open and routes to the new primary instead of making every client re-resolve DNS and reconnect. Lambda must be configured to connect to the proxy endpoint instead of the instance endpoint, and the function typically runs in the same VPC. The common trap is picking a caching or networking product because it sounds like it improves performance, when the real issue is connection management for a relational database.
- A. Amazon DynamoDB Accelerator (DAX) in-memory NoSQL cluster read cache — DAX is an in-memory read cache that works only with Amazon DynamoDB and its API. It does nothing for PostgreSQL on RDS and does not pool or manage TCP database connections.
- C. AWS Direct Connect dedicated physical fiber link to the RDS VPC subnet — AWS Direct Connect is a dedicated private network link between an on-premises site and AWS. It changes how traffic reaches AWS but does not pool connections or limit how many Lambda functions open connections to the database.
- D. Amazon S3 Transfer Acceleration global CloudFront edge network endpoints — S3 Transfer Acceleration speeds up long-distance uploads and downloads to Amazon S3 buckets using CloudFront edge locations. It has no connection with relational database connections or RDS failover.
Example 3 · 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?
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.
Example 4 · 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?
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.
Example 5 · Security · hard
A central platform security team allows application developers to create their own IAM execution roles for AWS Lambda functions, but must guarantee that no developer-created IAM role can ever exceed a maximum privilege ceiling (for example, developers may grant s3:* and dynamodb:*, but even if a developer attaches AdministratorAccess to a new Lambda role, the role must never be able to call iam:* or organizations:*). Which IAM feature enforces this maximum permission ceiling on delegated role creation?
Show answer and explanation
Correct answer: A. Attach an IAM Permissions Boundary policy to each developer-created Lambda role
Why
An IAM Permissions Boundary is a managed policy attached to an IAM user or role that defines the maximum permissions that entity can ever have. The effective permissions are the intersection of the identity-based policy and the permissions boundary — preventing privilege escalation when developers create new Lambda execution roles.
- B. Store the Lambda function deployment zip in an unencrypted public S3 bucket — Public S3 buckets decrease security and have no effect on IAM role privilege escalation.
- C. Use an Amazon S3 Bucket ACL instead of IAM execution roles on the function — S3 Bucket ACLs are legacy object-storage controls and cannot restrict iam:* or organizations:* API calls.
- D. Replace IAM roles with hardcoded AWS root account access keys in env variables — Using root access keys violates every AWS security best practice and bypasses IAM boundaries.
Example 6 · Troubleshooting and Optimization · easy
A developer wants their AWS Lambda function to emit custom business metrics (OrderValue, CheckoutLatencyMs) alongside high-cardinality dimensions (PaymentProvider, Region) into Amazon CloudWatch without making synchronous cloudwatch:PutMetricData network API calls that add latency and cost to every invocation. Which native CloudWatch feature lets Lambda write a specially structured JSON log line to stdout (CloudWatch Logs) so CloudWatch automatically extracts the custom metrics asynchronously?
Show answer and explanation
Correct answer: D. CloudWatch Embedded Metric Format (EMF) JSON written to CloudWatch Logs
Why
CloudWatch Embedded Metric Format (EMF) allows Lambda functions (and containers/EC2) to print structured JSON log events containing an _aws metadata header to standard output (CloudWatch Logs). CloudWatch automatically parses those log lines and extracts the custom metrics without requiring PutMetricData API calls.
- A. AWS CloudTrail Management Events log file integrity validation (SHA-256) — CloudTrail logs AWS control-plane API calls, not custom application metrics from stdout.
- B. Amazon S3 Server Access Logging delivered to an S3 Glacier archive vault — S3 access logs record storage HTTP requests and do not publish CloudWatch custom metrics.
- C. AWS Config conformance packs evaluating IAM password policies — AWS Config audits resource configuration compliance, not high-frequency Lambda metrics.
Example 7 · 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.)
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.
Example 8 · Troubleshooting and Optimization · hard
An AWS Lambda function processes CPU-intensive image resizing and takes 4,000 ms (4.0 seconds) when configured with 512 MB of memory. When the developer increases the function's memory allocation to 2,048 MB (4x memory), the execution duration drops to 1,000 ms (1.0 second) because Lambda allocates vCPU power proportionally to memory (1,769 MB = 1 full vCPU). Since AWS Lambda duration billing is proportional to $\text{GB-seconds} = \text{Memory (GB)} \times \text{Duration (s)}$, how does the duration compute cost of 2,048 MB for 1.0 s compare to 512 MB for 4.0 s?
Show answer and explanation
Correct answer: A. Identical compute cost (2.0 GB-seconds in both cases) with 4x faster latency
Why
Calculate the billed GB-seconds for both configurations: - Configuration A (512 MB = 0.5 GB for 4.0 s): $0.5\text{ GB} \times 4.0\text{ s} = \mathbf{2.0\text{ GB-seconds}}$ - Configuration B (2,048 MB = 2.0 GB for 1.0 s): $2.0\text{ GB} \times 1.0\text{ s} = \mathbf{2.0\text{ GB-seconds}}$ Therefore, the duration compute cost is identical (2.0 GB-seconds, 0% cost increase) while the user experiences 4x faster response latency (1.0 s vs 4.0 s)!
- B. 4x higher compute cost (8.0 GB-seconds vs 2.0 GB-seconds) for 2,048 MB RAM — Because duration dropped by 4x (4.0 s to 1.0 s), the 4x memory increase cancels out (2.0 GB * 1.0 s = 2.0 GB-s).
- C. 16x higher compute cost because Lambda bills quadratically above 1,024 MB — AWS Lambda bills linearly per GB-second, not quadratically.
- D. 50% lower compute cost (1.0 GB-seconds vs 2.0 GB-seconds) for 512 MB — At 512 MB (0.5 GB) for 4 seconds, the function consumes 0.5 * 4 = 2.0 GB-seconds, not 1.0.
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.
Frequently Asked Questions
How is the AWS Certified Developer - Associate (DVA-C02) scored and does it have negative marking?
The AWS Certified Developer - Associate (DVA-C02) administered by AWS carries no negative marking for incorrect responses, with a target passing benchmark of 72%. Candidates should attempt every question and use elimination across distractors.
What topics and syllabus domains are covered in this AWS Certified Developer - Associate (DVA-C02) practice bank?
This AWS Certified Developer - Associate (DVA-C02) practice bank covers 4 official syllabus domains: Development with AWS Services (32%), Security (26%), Deployment (24%), Troubleshooting and Optimization (18%). Currently 47 questions are published, each with a worked explanation.
How are the AWS Certified Developer - Associate (DVA-C02) questions and explanations checked on PrepIQ Hub?
Every AWS Certified Developer - Associate (DVA-C02) question on PrepIQ Hub is written for this site, with AI-assisted drafting, and mapped to the AWS blueprint. Before publication each batch passes automated checks for answer cues, such as a key that is longer than its distractors. Independent review by subject matter experts is under way, and corrections are welcome at corrections@prepiqhub.com.
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.