About this exam
An Associate-level AWS Certification for developers who build applications on AWS. It covers four domains: development with AWS services (Lambda, DynamoDB, API Gateway and more), security (authentication, authorization and encryption), deployment (CI/CD), and troubleshooting and optimization. DVA-C02 was retired on November 30, 2026, and its successor, DVA-C03, has been available since December 1, 2026.
Try a sample question
This is an original sample question written by itmoshi based on the exam objectives.
A sign-up API writes member records with PutItem to a DynamoDB table whose only primary key attribute is username (a partition key with no sort key). Two sign-up requests with the same username arrived almost simultaneously, and the later one overwrote the member who had just registered. Without any extra reads, the developer wants a single write that reliably fails if an item with the same username already exists. What should the developer do?
- ACall GetItem to check whether the username exists, and call PutItem only if it does not
- BChange the existence-check GetItem to a strongly consistent read, then call PutItem
- CAdd the condition expression attribute_not_exists(username) to PutItem and handle ConditionalCheckFailedException
- DEnable DynamoDB Streams and use Lambda to detect and report writes with the same username
Show answer and explanation
Answer:C To reliably write only if the item does not exist, in one operation, use a conditional write with attribute_not_exists.
Why it is correct
A PutItem with a condition expression evaluates the condition and performs the write as one atomic operation. With attribute_not_exists(username), the write is rejected if an item with that key already exists and ConditionalCheckFailedException is returned, which the application can treat as "already registered". No extra read is needed, and concurrent requests can no longer overwrite each other.
The other options
- ✗ A GetItem and PutItem are separate operations, so another request can slip in between the check and the write, and concurrent requests can still overwrite each other. It also needs an extra read. If you only need to show whether a username is taken, GetItem on its own is enough.
- ✗ B A strongly consistent read only guarantees that you see the latest write; the read and the write are still separate operations, so the race remains. Use it when you must read the latest value right after a write.
- ✗ D Streams deliver changes after the write, so the overwrite has already happened. Use them to trigger other processing, such as aggregation or notifications, from data changes.
Key takeaway
Protecting against concurrent writes → conditional writes (attribute_not_exists for creation, version-number optimistic locking for updates). Read-then-write is two operations and leaves a race.
Try 56 questions like this for free
itmoshi is an unofficial study service and is not affiliated with AWS or any exam provider.