DVA-C02 Practice Questions — Free

DVA-C02 is the AWS associate exam for the person writing the code rather than drawing the architecture. It assumes you already build on AWS with an SDK open; if you configure AWS more than you call it, SAA-C03 is the closer fit, and CLF-C02 is the cheaper place to start.

Development with AWS Services is the largest of its four domains, and it concentrates on what application code actually calls: Lambda, DynamoDB, API Gateway, S3 and the SDKs themselves. Security comes next, handled from inside an application, with identity and encryption done in code rather than in the console. Deployment covers shipping through a pipeline, and Troubleshooting and Optimization covers instrumenting what you have shipped well enough to debug it once it is live.

What is being tested is whether you can build against AWS's APIs rather than its console, so the questions below are written from the developer's side of that line: what the code does, what it is allowed to do, and what happens when it fails.

How DVA-C02 is weighted

  1. Development with AWS Services32%
  2. Security26%
  3. Deployment24%
  4. Troubleshooting and Optimization18%

Development with AWS Services

9 questions

  1. Question 1 of 25

    That system must let a diner cancel and immediately free the slot for others. What DynamoDB operation and condition fit?

    • A.A PutItem writing an empty item over the reservation
    • B.DeleteItem conditioned on the diner owning the reservationCorrect
    • C.An unconditional DeleteItem on the reservation key
    • D.A Scan followed by deleting every matching reservation

    Answer: B

    A conditional delete ensures only the owning diner can cancel, and removing the item frees the composite key for a new booking.

  2. Question 2 of 25

    An SQS consumer needs more time to process a particularly large or slow message before it becomes visible again to other consumers. What should be adjusted for that specific message?

    • A.Switch the entire queue from standard to FIFO, which extends visibility timeout
    • B.Delete and immediately re-send the message with a longer default timeout
    • C.Reduce the queue's overall message retention period for all messages
    • D.Extend the message's visibility timeout using ChangeMessageVisibilityCorrect

    Answer: D

    ChangeMessageVisibility lets a consumer extend the visibility timeout for a specific in-flight message it's still processing, preventing it from becoming visible to other consumers prematurely while genuinely still being worked on.

  3. Question 3 of 25

    An application ingests high-volume, real-time clickstream data and needs to process it as it arrives, rather than in scheduled batches. Which service is designed for this?

    • A.Amazon S3 Glacier, designed for long-term archival, not real-time ingestion
    • B.Amazon Kinesis Data StreamsCorrect
    • C.AWS Snowball, designed for offline bulk physical data transfer
    • D.AWS Database Migration Service, designed for migrating existing databases

    Answer: B

    Kinesis Data Streams is built for real-time ingestion and processing of high-volume streaming data like clickstreams, letting consumers process records as they arrive rather than waiting for a batch window.

  4. Question 4 of 25

    That feature-flag service must roll a flag change out gradually and roll back automatically if errors rise. What AppConfig feature does this?

    • A.Deployment strategies with CloudWatch alarm-based rollbackCorrect
    • B.Manual flag toggling performed separately per function
    • C.A DynamoDB Stream on the table that stores the flags
    • D.Immediate deployment of the new flag value to all targets

    Answer: A

    AppConfig deployment strategies control rollout pace and can roll back automatically when an associated alarm fires.

  5. Question 5 of 25

    An application's Lambda function needs to return a response to API Gateway that includes custom HTTP headers (like a CORS header) alongside the response body. What must the function's return value structure include?

    • A.A separate API call to a headers-specific endpoint after the main response is returned
    • B.Headers can only ever be set by API Gateway itself, never by the Lambda function
    • C.A structured response object with separate statusCode, headers, and body fieldsCorrect
    • D.Only the raw response body as a plain string, with no other structure supported

    Answer: C

    For a proxy-style Lambda integration, API Gateway expects the function to return a structured object with statusCode, headers, and body fields - the headers field is exactly where CORS or other custom headers are set.

  6. Question 6 of 25

    A developer wants a Lambda function to be invoked every 15 minutes with no external event. What should be configured?

    • A.A DynamoDB stream attached to a table as the trigger
    • B.An SQS queue with a 15-minute delivery delay set
    • C.An EventBridge scheduled rule with a rate expressionCorrect
    • D.An S3 event notification configured on a bucket

    Answer: C

    EventBridge scheduled rules invoke a function on a rate or cron expression independent of any data event.

  7. Question 7 of 25

    An SQS queue needs to guarantee messages are processed in the exact order they were sent, with no duplicate processing. What should be used?

    • A.A standard SQS queue, which does not guarantee strict ordering or exactly-once delivery
    • B.Amazon SNS alone, a pub/sub service rather than an ordered queue
    • C.Increasing the standard queue's visibility timeout, which does not affect message ordering
    • D.An SQS FIFO queue, which preserves order and exactly-once processing within a message groupCorrect

    Answer: D

    FIFO queues specifically guarantee strict ordering (within a message group) and exactly-once processing, unlike standard queues which prioritize throughput and availability over strict order.

  8. Question 8 of 25

    A developer wants to trace a request as it flows through API Gateway, Lambda, and DynamoDB, identifying where latency is actually occurring across that chain. What should be enabled?

    • A.CloudWatch Metrics alone, which reports aggregate numbers rather than per-request traces
    • B.AWS Config, which tracks resource configuration rather than tracing request latency
    • C.AWS X-Ray, tracing requests across services to visualize latency and bottlenecksCorrect
    • D.CloudTrail, which logs API management activity rather than tracing request latency

    Answer: C

    X-Ray traces individual requests end-to-end across multiple integrated services, visualizing exactly where time is spent - the right tool for pinpointing a specific bottleneck across a multi-service chain.

  9. Question 9 of 25

    A developer building a video platform needs uploaded videos transcoded into three resolutions in parallel, then a manifest generated once all three finish. What orchestration fits?

    • A.One Lambda doing all three sequentially inside 15 minutes
    • B.A Parallel state with three branches, then a manifest taskCorrect
    • C.An SQS queue with one consumer handling resolutions in turn
    • D.Three separate Lambda functions with no coordination

    Answer: B

    A Parallel state runs the three transcodes concurrently and proceeds to the manifest step only when all branches complete.

Security

5 questions

  1. Question 10 of 25

    A developer wants CloudFront to be the only way to reach an S3 origin, blocking direct bucket URLs. What should be configured?

    • A.Origin Access Control plus a bucket policy scoped to the distributionCorrect
    • B.Disabling static website hosting on the origin S3 bucket
    • C.Generating a presigned URL for every single object on demand
    • D.Making the bucket and every object in it publicly readable

    Answer: A

    OAC lets CloudFront sign origin requests, and a bucket policy restricted to the distribution rejects direct access.

  2. Question 11 of 25

    A developer wants a KMS key using a public/private key pair, so external parties can encrypt data with a public key without needing AWS credentials, while only the application can decrypt with the private key. What KMS key type supports this?

    • A.A standard symmetric KMS key, which uses one shared key for both encrypt and decrypt
    • B.A KMS key with automatic annual rotation enabled, unrelated to symmetric vs asymmetric type
    • C.A multi-Region KMS key, which addresses cross-Region replication rather than key type
    • D.An asymmetric KMS key, using a public/private key pair rather than a single symmetric keyCorrect

    Answer: D

    Asymmetric KMS keys use a public/private key pair - the public portion can be distributed for external parties to encrypt data without AWS credentials, while only holders of the private key (managed by KMS) can decrypt.

  3. Question 12 of 25

    A developer must ensure a Lambda function's environment variables containing a config value are encrypted with a company-controlled key rather than the default. What should be set?

    • A.Base64 encoding of the configuration values before setting
    • B.Storing the configuration values inside the function code
    • C.A customer managed KMS key for environment variable encryptionCorrect
    • D.No change, since environment variables are stored as plaintext

    Answer: C

    Lambda encrypts environment variables at rest and lets a customer managed key be specified for control over that encryption.

  4. Question 13 of 25

    An application's Lambda function needs to decrypt data encrypted with a KMS key owned by a different AWS account, as part of a legitimate cross-account architecture. What must be true for this to succeed?

    • A.Cross-account KMS decryption isn't achievable under any configuration, regardless of key policy
    • B.Only the calling account's own IAM policy matters; the key's policy elsewhere is irrelevant
    • C.The key's policy must grant the calling account's role decrypt access, and its own IAM policy must tooCorrect
    • D.The key must be copied entirely into the calling account before it can be used there

    Answer: C

    Cross-account KMS access requires both sides to grant permission - the key's own policy in the owning account must allow the external principal, and that principal's own IAM policy must also permit the KMS action - a two-sided grant, not either side alone.

  5. Question 14 of 25

    A developer's API Gateway must accept requests only from the company's mobile app, not from arbitrary callers who obtain the endpoint. What is the appropriate mechanism?

    • A.IP allowlisting, even though mobile IPs change constantly
    • B.Relying on the endpoint URL never being published anywhere
    • C.Cognito or a Lambda authorizer validating a per-user tokenCorrect
    • D.An API key embedded in the app, which can be extracted

    Answer: C

    Per-user token validation authenticates each request - an embedded API key is extractable from any client binary and identifies the app, not the user, and an unpublished URL is not a security control.

Deployment

6 questions

  1. Question 15 of 25

    A developer's SAM template needs to define an EventBridge scheduled rule that triggers a Lambda function nightly. What SAM resource type or event source supports this without writing raw CloudFormation for the rule?

    • A.A Schedule event source defined directly on the Lambda function's SAM resourceCorrect
    • B.Only a raw AWS::Events::Rule CloudFormation resource can define a scheduled trigger
    • C.A DynamoDB Stream event source, which is unrelated to time-based scheduling
    • D.SAM does not support any form of scheduled Lambda trigger under any configuration

    Answer: A

    SAM provides a simplified Schedule event source type directly on a function's resource definition, letting a scheduled trigger be defined without hand-writing the underlying raw CloudFormation Events::Rule resource.

  2. Question 16 of 25

    That team's SAM template has a Lambda function referencing a local code directory. What sequence packages and deploys it?

    • A.sam build, then sam deployCorrect
    • B.cloudformation create-stack directly on the template
    • C.npm publish, then sam deploy
    • D.docker push, then cloudformation deploy

    Answer: A

    sam build prepares the function artifacts and sam deploy packages and deploys the resulting stack - deploying the raw template without building skips artifact preparation.

  3. Question 17 of 25

    A developer's Lambda function needs a large shared dependency used by five other functions. What avoids bundling it five times?

    • A.Increasing each function's memory
    • B.Merging all five functions into one
    • C.A Lambda layer attached to each functionCorrect
    • D.Copying the dependency into each package

    Answer: C

    A layer packages the dependency once and is attached to each function, keeping individual packages small.

  4. Question 18 of 25

    That team's ECS task definition references image tag 'latest', and a redeploy did not pick up the new image. Why?

    • A.Fargate task definitions do not support image tag references
    • B.The new image was pushed to a repository in the wrong Region
    • C.ECS on Fargate is unable to pull images from ECR repositories
    • D.The tag reference did not change, so ECS saw nothing to roll outCorrect

    Answer: D

    A mutable 'latest' tag gives ECS no signal that anything changed - referencing an immutable tag or digest per build is what triggers a real rollout.

  5. Question 19 of 25

    A developer wants CloudFormation to fail early if a parameter value is outside an allowed set. What template feature enforces this?

    • A.AllowedValues or AllowedPattern on the ParameterCorrect
    • B.A Mapping keyed by the parameter's value
    • C.A Condition evaluated during resource creation
    • D.An Output declared for the parameter's value

    Answer: A

    Parameter constraints such as AllowedValues reject invalid input before the stack attempts any resource creation.

  6. Question 20 of 25

    An application's CodeBuild project needs access to a private npm registry requiring authentication during the build phase, without hardcoding the registry credential in buildspec.yml. What is the recommended approach?

    • A.Email the credential to each developer to manually paste into their local environment
    • B.Commit the credential to the source repository alongside the application code
    • C.Hardcode the credential directly as a plaintext value within buildspec.yml
    • D.Retrieve the credential from Secrets Manager or Parameter Store within the build phaseCorrect

    Answer: D

    Retrieving the credential from Secrets Manager or Parameter Store at build time keeps it out of the version-controlled buildspec.yml file entirely, the same discipline applied to any other runtime secret in this project's broader security practices.

Troubleshooting and Optimization

5 questions

  1. Question 21 of 25

    An application's Lambda function's Duration metric shows a value very close to, but never exceeding, its configured timeout on every single invocation. What is the most likely explanation?

    • A.This pattern is coincidental and does not indicate anything worth investigating
    • B.The function's memory allocation is irrelevant to this specific pattern and needs no review
    • C.The function is genuinely close to timing out and the timeout or code likely needs reviewCorrect
    • D.CloudWatch is rounding the Duration metric incorrectly, and the real values are actually much lower

    Answer: C

    Duration consistently sitting near the timeout ceiling (even if technically never breaching it) is a real warning sign the function is close to failing - worth investigating whether the timeout needs raising or the function's actual work needs optimizing, rather than dismissing it as coincidental.

  2. Question 22 of 25

    An application's Step Functions execution fails at a specific state, and the developer wants to see exactly what input that state received and what error caused the failure. Where should this be reviewed?

    • A.AWS Config, which tracks resource configuration rather than individual execution detail
    • B.CloudWatch Metrics alone, which shows aggregate execution counts rather than per-state detail
    • C.The state machine's definition file alone, which shows intended structure, not actual execution detail
    • D.The Step Functions execution's event history, showing input, output, and error detail per stateCorrect

    Answer: D

    A Step Functions execution's event history records the actual input, output, and error detail at each state transition - the definition file only shows the intended structure, not what actually happened during a specific real execution.

  3. Question 23 of 25

    A developer's application shows increased latency specifically on cold-started Lambda invocations for a function using a container image, compared to a similarly-sized zip-based function. What is a likely contributing factor?

    • A.Image size has no measurable relationship to cold-start initialization time
    • B.Zip-based functions always have strictly worse cold-start latency than any image
    • C.Container images tend to be larger and can take longer to initialize on a cold startCorrect
    • D.Container image-based functions never experience a cold start at all

    Answer: C

    Container images tend to be larger than an equivalent zip deployment package, and image size is a real factor in cold-start initialization time - worth investigating whether the image can be slimmed down, or whether Provisioned Concurrency is warranted if this path is genuinely latency-sensitive.

  4. Question 24 of 25

    A DynamoDB table is experiencing throttled requests during a traffic spike, and CloudWatch metrics show ConsumedWriteCapacityUnits nearing the table's provisioned limit uniformly across all partitions. What is a reasonable next step?

    • A.Enable DynamoDB Streams, which captures change events rather than addressing capacity throttling
    • B.Increase provisioned write capacity, or switch to On-Demand mode if traffic is genuinely unpredictableCorrect
    • C.Redesign the partition key, since uniform consumption across partitions indicates a hot-partition problem
    • D.Add a Global Secondary Index, which addresses query patterns rather than overall capacity

    Answer: B

    Uniform consumption near the provisioned limit across all partitions (as opposed to one partition being disproportionately hot) points at genuinely insufficient overall capacity, not a key-design problem - increasing capacity or moving to On-Demand mode is the direct fix for this specific pattern.

  5. Question 25 of 25

    A developer's Lambda function works locally but fails in AWS with 'Unable to import module'. What is the most likely cause?

    • A.The function's configured timeout value is too short
    • B.The function is deployed in a different Region than expected
    • C.A dependency is missing from the package or layerCorrect
    • D.The execution role lacks a required IAM permission

    Answer: C

    This error means the runtime could not find a module the handler imports - almost always a dependency present locally but not bundled into the package or provided by a layer.

20 more free after signup, then the full 400-question bank for $12.

Get 20 more free questions