CertCrack

AWS Developer Associate · DVA-C02

DVA-C02 Practice Exam: 700 Questions with Explanations

Preparing for the AWS Certified Developer – Associate (DVA-C02) certification? CertCrack gives you 700 original practice questions mapped to the official DVA-C02 exam guide — development with AWS services (32%), security (26%), deployment (24%), and troubleshooting and optimization (18%). Every question includes a detailed explanation so you learn the why, not just the answer.

What's inside

Try 30 sample questions

These are real samples from the DVA-C02 bank — the full version has 700 like these.

1. A developer wants to invoke a Lambda function over HTTPS without setting up API Gateway, for a low-traffic internal tool. Which feature should the developer use?

  1. An Application Load Balancer with a Lambda target group
  2. Amazon CloudFront with a custom origin
  3. Lambda function URLs, which provide a dedicated HTTPS endpoint with configurable auth (NONE or AWS_IAM)
  4. AWS AppSync
Correct answer: C. Correct: Lambda function URLs give a built-in HTTPS endpoint, ideal for simple use cases, with NONE or AWS_IAM auth. Why others are wrong: an ALB adds cost and complexity for a low-traffic tool; CloudFront is a CDN, overkill here; AppSync is for GraphQL APIs, not plain HTTPS invocation.

2. A team wants immutable deployments on Beanstalk but their deployment takes 20 minutes due to a large fleet. They want to keep the safety of immutable while reducing deploy time. What is a reasonable optimization?

  1. Add more instances to deploy faster
  2. Reduce fleet size via right-sizing, or accept the time as the cost of immutable safety — alternatively use rolling with additional batch for a faster but slightly less isolated deployment
  3. Switch to all-at-once, which is equally safe
  4. Immutable deploy time cannot be influenced
Correct answer: B. Correct: immutable time scales with fleet size; right-sizing reduces it, and rolling with additional batch is the legitimate faster-but-safe alternative. Why others are wrong: all-at-once sacrifices the safety being preserved; deploy time is influenced by fleet size and health check settings; adding instances increases the fleet to replace, slowing immutable further.

3. A developer assumes a role with the default session duration. Sixty minutes later the application starts receiving expired-token errors. Why?

  1. STS automatically renews the credentials in the background
  2. The role was deleted after one hour
  3. The temporary credentials expired; the application must call AssumeRole again for fresh credentials
  4. The credentials converted into permanent IAM user keys
Correct answer: C. Correct: Temporary credentials have a fixed lifetime (one hour by default); once expired, the application must re-assume the role. Why others are wrong: STS never auto-renews sessions; the role itself persists; temporary credentials can never convert into permanent ones.

4. A security review requires that a Lambda function's environment variables containing database credentials be encrypted with a customer managed KMS key rather than the default AWS managed key. How should the team comply?

  1. No action is needed; environment variables are never encrypted.
  2. Move the credentials to the function's /tmp storage, which uses customer managed keys.
  3. Store the credentials in AWS Secrets Manager and leave the environment variables as they are.
  4. Configure a customer managed KMS key on the function's environment variable encryption settings, so Lambda uses it instead of the default AWS managed key.
Correct answer: D. Correct: Lambda encrypts environment variables at rest by default with an AWS managed key, and you can specify a customer managed key per function for stricter control. Why others are wrong: environment variables are encrypted at rest by default (option 1 is factually wrong). /tmp is ephemeral scratch space with no CMK option (option 2). Secrets Manager (option 3) is good practice for secrets generally, but it does not satisfy the requirement to encrypt the environment variables themselves with a customer managed key.

5. A team runs an A/B test of two application versions for a week, routing 50% of users to each, then permanently adopts the winner. Which deployment concept does this resemble and what distinguishes it from blue/green?

  1. It resembles blue/green's two-environment setup, but blue/green is a deployment safety technique with a quick cutover, whereas a week-long 50/50 split is an experimentation pattern, not a deployment strategy
  2. It is exactly canary deployment, which always runs for a week
  3. It is a rolling deployment with two batches
  4. It is an immutable deployment because two fleets exist
Correct answer: A. Correct: blue/green uses two environments for safe cutover and fast rollback; a prolonged 50/50 split is experimentation (A/B testing), a different goal with different tooling. Why others are wrong: canary uses a small traffic percentage briefly, not 50/50 for a week; rolling updates one fleet in place; immutable is about fleet replacement, not traffic experimentation.

6. Which of the following is a managed policy?

  1. An AWS managed policy such as AmazonS3ReadOnlyAccess that AWS maintains and updates centrally
  2. An inline policy embedded directly in a single IAM user
  3. A bucket policy attached to an S3 bucket
  4. A permissions boundary document
Correct answer: A. Correct: AWS managed policies are created and maintained by AWS and can be attached to many identities, receiving central updates. Why others are wrong: an inline policy is embedded in one identity and is not managed; a bucket policy is resource-based; a permissions boundary is a maximum-permissions cap, not a managed policy.

7. A mobile app lets users sign in with Google and then upload photos directly to S3. Which STS operation gives the app temporary AWS credentials after Google authentication?

  1. AssumeRole
  2. GetSessionToken
  3. AssumeRoleWithSAML
  4. AssumeRoleWithWebIdentity
Correct answer: D. Correct: AssumeRoleWithWebIdentity is built for OIDC web identity federation with providers like Google, Facebook, or Login with Amazon. Why others are wrong: AssumeRole requires an existing IAM principal; GetSessionToken is for IAM users, typically with MFA; AssumeRoleWithSAML is for SAML-based enterprise identity providers, not OIDC web logins.

8. A team debates rolling vs. immutable for their Beanstalk application. Their top priority is the safest possible deployment and cost is a secondary concern. Their second priority is fast rollback. Which should they choose and why?

  1. Rolling, because it is the safest strategy available on Beanstalk
  2. All at once, because it completes fastest and therefore has the smallest failure window
  3. Rolling with additional batch, because it never provisions new instances
  4. Immutable, because the old fleet stays intact until the new fleet is verified, making rollback a simple traffic shift back
Correct answer: D. Correct: immutable keeps the entire old fleet untouched until the new fleet passes health checks, so rollback is just routing back — the safest profile. Why others are wrong: rolling is less safe than immutable (in-place changes, partial states); all-at-once is the riskiest; rolling with additional batch does provision extra instances.

9. During flash-sale spikes, an application intermittently receives ProvisionedThroughputExceededException from DynamoDB. The exceptions clear on their own within seconds, and overall consumed capacity stays within provisioned limits. What is the most appropriate client-side handling?

  1. Let the AWS SDK retry throttled requests with exponential backoff and jitter, and use Contributor Insights to find any hot keys driving the spikes
  2. Disable SDK retries so failures surface immediately and operators can raise capacity manually
  3. Switch all reads to strongly consistent to reduce the number of retryable errors
  4. Increase the Lambda function timeout so requests wait longer for capacity
Correct answer: A. Correct: The AWS SDK already retries throttled requests with exponential backoff and jitter, which is the standard client-side handling for transient ProvisionedThroughputExceededException errors, while Contributor Insights identifies any hot keys behind the spikes. Why others are wrong: disabling retries turns transient throttles into hard failures; strongly consistent reads consume more RCUs and would worsen throttling; extending a Lambda timeout cannot create throughput capacity that does not exist.

10. A Lambda function needs 2 vCPUs for a compute-heavy task. What should the developer know about Lambda CPU allocation?

  1. CPU is fixed at 1 vCPU regardless of memory
  2. CPU can be set independently via the console
  3. CPU scales proportionally with memory; at about 3 GB the function gets roughly 2 vCPUs, so there is no separate CPU setting
  4. Graviton must be enabled for 2 vCPUs
Correct answer: C. Correct: Lambda allocates CPU proportional to memory (1,769 MB is approximately 1 vCPU), so ~3 GB yields ~2 vCPUs. Why others are wrong: CPU is not fixed; there is no independent CPU slider; Graviton (arm64) affects price/performance, not the memory-CPU ratio.

11. What is the difference between an identity pool's authenticated role and unauthenticated role?

  1. The authenticated role serves signed-in users with broader permissions, while the unauthenticated role serves guests with minimal permissions
  2. They are the same role under two names
  3. The unauthenticated role receives administrative permissions
  4. Roles are optional in identity pools
Correct answer: A. Correct: Identity pools maintain two default roles so guests get least privilege while signed-in users get their scoped access. Why others are wrong: the roles are distinct by design; guests must never be privileged; a role mapping is required to vend credentials.

12. A developer runs a database migration that must execute exactly once per deployment, after the new code is in place but before traffic shifts. In Beanstalk, where should this go?

  1. A commands: entry, which runs on every instance on every deploy including scaling events
  2. In the Dockerfile CMD
  3. As a cron job on the instances
  4. A container_command in .ebextensions, which runs once per deployment on the instance (leader-only for multi-instance via leader election)
Correct answer: D. Correct: container_commands run once per deployment during the staging phase, and leader-only execution restricts one-time tasks to a single instance. Why others are wrong: commands: run before the app is staged and on every scale-out too; Dockerfile CMD starts the app, not migrations; cron is unscheduled relative to deployments.

13. During load testing, an API's p99 Latency metric climbs to 2.5 seconds while IntegrationLatency for the same period stays under 200 ms. The integration is a Lambda function that logs show completes quickly. Where should the developer investigate?

  1. The Lambda function's cold starts, because IntegrationLatency excludes them
  2. The DynamoDB table the Lambda reads from, since slow queries inflate API Gateway latency
  3. Processing that happens inside API Gateway before or after the integration call, such as the Lambda authorizer, request/response mapping templates, or throttling delays
  4. The client's network connection, because the Latency metric is measured at the client's device
Correct answer: C. Correct: Latency measures the full round trip at API Gateway while IntegrationLatency measures only the backend call, so a large gap points to time spent inside API Gateway itself — the Lambda authorizer, mapping templates, or throttling-related delays. Why others are wrong: cold starts and downstream DynamoDB slowness would inflate IntegrationLatency, which is low here; the Latency metric is measured at API Gateway, not on the client's device.

14. An EKS cluster runs microservices that need access to DynamoDB and S3 without storing any AWS keys in the cluster. Which approach is correct?

  1. Create an IAM user for each pod and mount its keys as a secret
  2. Store long-lived access keys in the cluster's Secrets Manager
  3. Use IAM roles for service accounts (IRSA), mapping Kubernetes service accounts to IAM roles through the cluster's OIDC provider
  4. Use the account's root credentials in a DaemonSet
Correct answer: C. Correct: IRSA lets each pod assume a scoped IAM role via AssumeRoleWithWebIdentity through the cluster OIDC provider — no stored keys anywhere. Why others are wrong: per-pod IAM users and long-lived keys in Secrets Manager reintroduce static credentials; root credentials must never be used for workloads.

15. A developer publishes a Lambda version after testing. A teammate asks whether the code of that published version can be edited later to fix a bug. What is the correct answer?

  1. Published Lambda versions are immutable; the developer must publish a new version with the fix
  2. Yes, versions can be edited in the console at any time
  3. Only the $LATEST version is immutable
  4. Versions auto-update when the underlying runtime is patched
Correct answer: A. Correct: each published version is an immutable snapshot of code plus configuration. Why others are wrong: published versions cannot be edited; $LATEST is the mutable working copy, not immutable; runtime patches do not change published version code.

16. A developer wants messages that fail processing after 5 attempts to be isolated for inspection. What should be configured?

  1. A FIFO queue
  2. A dead-letter queue with maxReceiveCount=5 on the source queue's redrive policy
  3. Long polling
  4. Message timers
Correct answer: B. Correct: redrive policies route repeatedly-failed messages to a DLQ. Why others are wrong: FIFO is about ordering; long polling reduces empty receives; delay queues postpone initial delivery.

17. A developer wants to prevent any stack update from replacing a production database, while still allowing other updates. Which is the right control?

  1. Setting the stack to REVIEW_IN_PROGRESS
  2. A stack policy denying Update:Replace on the database resource
  3. DeletionPolicy: Delete on the database
  4. Removing the database from the template
Correct answer: B. Correct: stack policies can deny specific update actions (like replacement) on chosen resources while permitting everything else. Why others are wrong: DeletionPolicy: Delete is the dangerous opposite; removing the resource from the template would delete it; REVIEW_IN_PROGRESS is a transient change-set state, not a guardrail.

18. A startup wants the cheapest, lowest-latency option for a simple Lambda-backed JSON API with JWT authorization and no need for usage plans. Which should they choose?

  1. REST API with caching enabled
  2. HTTP API, which offers lower latency and cost than REST APIs with JWT authorizer support
  3. WebSocket API
  4. Application Load Balancer
Correct answer: B. Correct: HTTP APIs are cheaper and faster for proxy-style workloads and support JWT authorizers. Why others are wrong: REST APIs cost more and add unneeded features; WebSocket is for persistent connections; ALB lacks native JWT authorizers.

19. A team defines their API in an OpenAPI 3.0 specification and wants to import it into API Gateway to create the methods and models automatically. What should they do?

  1. Manually recreate each method
  2. Use CloudFormation only for Lambda
  3. Use the API Gateway import API or console import, which creates resources and methods from the OpenAPI definition
  4. Export from CloudWatch
Correct answer: C. Correct: API Gateway natively imports OpenAPI/Swagger definitions to scaffold the API. Why others are wrong: manual recreation is error-prone and slow; CloudFormation provisions but the import feature is purpose-built; CloudWatch does not export API definitions.

20. Two warehouse scanners can update the same inventory item's quantity simultaneously. The team added a versionNumber attribute and wants an update to succeed only if the version has not changed since it was read, retrying on conflict. Which DynamoDB feature implements this optimistic locking?

  1. Strongly consistent reads, which serialize concurrent writers
  2. TransactWriteItems across the item and a lock record
  3. Enabling DynamoDB Streams to detect conflicting writes after the fact
  4. An UpdateItem with a ConditionExpression such as versionNumber = :expected, incrementing the version on each successful write
Correct answer: D. Correct: A ConditionExpression such as versionNumber = :expected makes the UpdateItem fail when another writer changed the version first, and incrementing the version on each successful write implements optimistic locking with automatic retry on conflict. Why others are wrong: strongly consistent reads do not serialize or block concurrent writers; TransactWriteItems is designed for atomic multi-item updates and is heavier than a single conditional write; DynamoDB Streams only detect conflicts after they happened instead of preventing them.

21. A code review finds AWS access keys committed in the application source. What is the complete remediation?

  1. Leave them — the repository is private
  2. Rotate the keys next quarter
  3. Add a code comment warning future developers
  4. Remove the keys from the code immediately, revoke and rotate them, replace them with IAM roles or Secrets Manager, and scan the repository history for other exposures
Correct answer: D. Correct: Full remediation removes the secret, invalidates it, replaces the pattern, and checks history since private repos still leak. Why others are wrong: private repositories are breached and scraped; delayed rotation extends exposure; a comment changes nothing.

22. What can a resource policy on an API Gateway REST API do?

  1. Replace the need for authorizers entirely
  2. Issue bearer tokens to clients
  3. Encrypt request payloads
  4. Allow or deny invocation based on source IP, VPC/VPC endpoint, or AWS principal — evaluated before authorizers run
Correct answer: D. Correct: Resource policies are JSON policy documents on the API itself that gate access by network or principal. Why others are wrong: they complement rather than replace authorizers; they issue nothing; they do not encrypt.

23. A pipeline execution is stuck: the deploy action has been running for an hour against an unhealthy environment, and the team wants to stop it immediately without deleting the pipeline. What should they do?

  1. Disable the pipeline's source trigger so no new executions start
  2. Stop the pipeline execution from the pipeline's execution history in the console or CLI
  3. Delete the deploy action from the pipeline definition to cancel the run
  4. Wait for the action to time out, since executions cannot be stopped manually
Correct answer: B. Correct: CodePipeline supports stopping an in-progress execution, which halts the running actions without deleting the pipeline definition. Why others are wrong: deleting the action changes the pipeline definition and does not reliably cancel the running execution; executions do not have to run to timeout — manual stop exists; disabling the trigger only prevents future executions and does nothing about the stuck one.

24. A developer enables caching on a REST API method to reduce backend load. A client reports seeing another user's data in a cached response. What is the MOST likely cause?

  1. Caching is not supported on REST APIs
  2. The TTL is too long
  3. The cache key does not include the Authorization header or user-identifying parameter, so responses are shared across users
  4. Lambda concurrency is too low
Correct answer: C. Correct: cache keys must incorporate identity (headers, query params); otherwise personalized responses leak across callers. Why others are wrong: caching is fully supported; TTL length does not cause cross-user leakage; Lambda concurrency is unrelated to cache correctness.

25. A developer needs to copy a DynamoDB table's data to another account for migration. Which approach is simplest and serverless?

  1. Manual retyping
  2. DAX replication
  3. Email CSVs
  4. Export the table to S3, then import from S3 into the destination table (DynamoDB import from S3)
Correct answer: D. Correct: native S3 export/import moves data between accounts without servers. Why others are wrong: manual methods do not scale; DAX does not migrate; CSVs via email are absurd.

26. A worker queue processes image-resize jobs. Occasionally a corrupt image makes the consumer crash; the message becomes visible again, gets picked up, and crashes the consumer in an endless cycle, blocking healthy messages behind it in a FIFO queue. How should the developer isolate these poison messages?

  1. Increase the visibility timeout to 12 hours so the poison message stays hidden longer
  2. Configure a redrive policy on the source queue with a maxReceiveCount (for example 3), routing repeatedly-failing messages to a dead-letter queue for inspection
  3. Enable content-based deduplication so the corrupt image is only delivered once
  4. Shorten the message retention period so poison messages expire quickly
Correct answer: B. Correct: A redrive policy with a maxReceiveCount (e.g., 3) moves a message to the dead-letter queue after it has been received that many times without deletion, quarantining the poison message for inspection while healthy messages flow. Why others are wrong: a longer visibility timeout merely delays the message's return without isolating it; content-based deduplication suppresses duplicate sends, not processing crashes; shortening retention destroys the evidence without promptly breaking the crash cycle.

27. A message in an SQS queue is picked up by a consumer but processing takes longer than the visibility timeout. What happens?

  1. The message becomes visible again and may be delivered to another consumer, risking duplicate processing
  2. The message is deleted
  3. The queue is paused
  4. The message is encrypted
Correct answer: A. Correct: visibility timeout hides the message during processing; expiry re-queues it. Why others are wrong: deletion requires explicit DeleteMessage; queues do not pause; encryption is separate.

28. A team wants deployments where a failed new version never touches production traffic, and they want the old environment preserved for instant rollback. They run on EC2 with a load balancer. Which strategy should they choose?

  1. Blue/green: run the new version on a separate (green) environment, shift traffic only after validation, keep blue for instant rollback
  2. Rolling: update instances in place behind the load balancer
  3. All-at-once: fastest path to the new version
  4. Rolling with additional batch: adds capacity during the update
Correct answer: A. Correct: blue/green isolates the new version in a separate environment so production traffic never touches it until validated, and the untouched blue environment enables instant rollback. Why others are wrong: rolling and rolling-with-batch update production instances in place, exposing traffic to the new version during rollout; all-at-once has the largest blast radius.

29. How does Secrets Manager rotate credentials for an RDS database?

  1. By running manual SQL supplied by the developer each time
  2. From the developer's laptop over a VPN
  3. With a Lambda rotation function — AWS supplies templates — that updates both the secret and the database password in a coordinated multi-step flow
  4. Through IAM policy changes alone
Correct answer: C. Correct: Rotation Lambda functions execute the create/set/test/finish steps against both the secret and the database. Why others are wrong: manual SQL defeats automation; laptop-based rotation is insecure and unscalable; IAM policies authorize but do not rotate.

30. A company requires cryptographic verification that only approved, signed Lambda deployment packages can run in production. Which feature should the developer use?

  1. Environment variable encryption
  2. VPC endpoints
  3. Function URLs with AWS_IAM auth
  4. AWS Lambda code signing with AWS Signer, which validates signatures before allowing deployment
Correct answer: D. Correct: code signing policies verify package signatures at deploy time, blocking tampered or unsigned code. Why others are wrong: env var encryption protects secrets, not code integrity; VPC endpoints control network access; function URL auth controls invocation, not package integrity.
  • Switch the functions to arm64 (Graviton2) architecture
  • Enable provisioned concurrency on all functions
  • Double the memory of each function
  • Correct answer: B. Correct: arm64 Lambda functions cost about 20 percent less per millisecond than x86_64, and pure Python code typically runs unchanged on ARM. Why others are wrong: A) Staying on x86_64 pays the higher per-millisecond rate. C) Provisioned concurrency adds hourly charges for capacity that may sit idle. D) Doubling memory doubles the per-millisecond price without benefit.

    Get full access

    One payment unlocks the online question bank and the full PDF.

    $10 · 3 months access

    Get full access Also available on Udemy Download the free sample PDF (30 questions)

    15-day money-back guarantee (before 25% of questions attempted). PDF downloads are non-refundable.

    Exam facts: AWS Certified Developer – Associate (DVA-C02)

    • Exam: AWS Certified Developer – Associate (DVA-C02)
    • Cost: $150 USD
    • Duration: 130 minutes
    • Questions: 65 — multiple choice and multiple response (50 scored, 15 unscored)
    • Passing score: 720 (scaled score of 100–1,000)
    • Validity: 3 years

    Frequently asked questions

    How long do I get access?

    Three months (90 days) from purchase, covering both the interactive online bank and the full PDF download. Access can be extended.

    Is there a free trial?

    Yes — a free 30-question sample quiz and a free sample PDF are available with no account required, so you can judge the quality before paying.

    Are these questions like the real DVA-C02 exam?

    All 700 questions are mapped to the official DVA-C02 exam objectives, written in the same style and difficulty as the real exam.

    Can I study offline?

    Yes. Your purchase includes the complete question bank as a downloadable PDF for offline study.

    What is the refund policy?

    Full access is refundable within 15 days, or before 25% of the questions have been attempted — whichever comes first. Downloaded PDFs are non-refundable.

    How much does the DVA-C02 exam cost?

    The AWS Certified Developer – Associate exam costs $150 USD.

    How many questions are on the DVA-C02 exam?

    65 questions in 130 minutes — multiple choice and multiple response. 50 questions are scored and 15 are unscored trial questions, and you can't tell which is which during the exam.

    What is the passing score for DVA-C02?

    720 on AWS's scaled score range of 100 to 1,000. Scoring is compensatory — you need to pass the exam overall, not each section.

    How long is the Developer Associate certification valid?

    Three years. Before it expires, you recertify by passing the current version of the exam or a higher-level AWS exam.

    Where can I practice for the DVA-C02 exam for free?

    Right here on CertCrack. Start with the free 30-question sample quiz and the free sample PDF on this page — no account needed — and read the free Developer Associate study guidebook. When you're ready for the full bank, this page gives you every practice question with detailed explanations for $10.

    Get a free practice question every week

    Join the list — one exam-style question with a full explanation, every week. No spam.