AWS Certified Developer – Associate

Question bank

Amazon Web Services logo

AWS Certified Developer – Associate

DVA-C02

42 AWS Certified Developer – Associate questions with the correct answer and a written explanation, organised across 4 exam domains.

42 questions
4 domains
Foundation level

Question index

Jump straight to any question. Answers and explanations are inline.

Deployment

10 questions in this domain

  1. Question 1Single Choice

    In DynamoDB, what is the main role of the partition key when the service stores an item?

    • AUses a hash to locate partitionCorrect answer
    • BSorts items within a partition
    • CReplicates data across regions
    • DSets read and write capacity

    Why this is the answer

    The partition key is hashed to identify the physical partition that stores the item. This enables data distribution.

  2. Question 2Multiple Select

    Which statements correctly describe the main differences between provisioned and on-demand capacity modes in DynamoDB?

    • AProvisioned requires specifying RCU/WCUCorrect answer
    • BOn-demand scales automatically for spikesCorrect answer
    • COn-demand is always cheapest
    • DProvisioned suits unpredictable workloads

    Why this is the answer

    Provisioned mode requires defined capacity; on-demand mode scales automatically. On-demand is not always cheaper, and provisioned mode suits predictable workloads.

  3. Question 3Interactive

    Study the Python snippet and determine which DynamoDB feature is being implemented by the update operation.

    • AOptimistic locking with condition expressionsCorrect answer
    • BEventually consistent read request
    • CGlobal secondary index query
    • DDynamoDB Streams processing

    Why this is the answer

    The version check in the condition expression prevents concurrent writes from overwriting each other, a pattern known as optimistic locking.

  4. Question 4Single Choice

    What does the sort key in DynamoDB allow you to do with items that share the same partition key?

    • AOrdered grouping and range queriesCorrect answer
    • BCross-region data replication
    • CAutomatic item expiration
    • DCapacity scaling across partitions

    Why this is the answer

    A sort key organizes items under the same partition key, enabling ordered grouping and range queries such as begins_with and between.

  5. Question 5Multiple Select

    Which statements correctly compare Global Secondary Indexes with Local Secondary Indexes in DynamoDB tables? Select all that apply.

    • AGSIs can be added laterCorrect answer
    • BLSIs share the table partition keyCorrect answer
    • CLSIs can use a different partition key
    • DGSIs must be created with the table

    Why this is the answer

    GSIs can be created anytime and may use a different partition key; LSIs must be created with the table and share its partition key.

  6. Question 6Interactive

    Consider the Python snippet and state what purpose the generated URL serves for a private Amazon S3 object.

    • AGrants temporary access without credentialsCorrect answer
    • BPermanently makes object public
    • CApplies lifecycle management rule
    • DReplicates object to another bucket

    Why this is the answer

    A pre-signed URL grants temporary access to a private object without requiring the user to possess AWS credentials.

  7. Question 7Single Choice

    What consistency model does Amazon S3 provide for both new object puts and object overwrites?

    • AStrong read-after-write consistencyCorrect answer
    • BEventual consistency only
    • CNo consistency guarantee
    • DConsistent only for new objects

    Why this is the answer

    S3 delivers strong read-after-write consistency for all applications, including overwrites and new puts, so no polling logic is needed.

  8. Question 8Multiple Select

    Which statements correctly describe the behavior of Amazon SQS visibility timeout and dead-letter queues during message processing?

    • ADLQ stores messages after retries exhaustedCorrect answer
    • BVisibility timeout hides messages being processedCorrect answer
    • CDLQ replaces consumer code
    • DVisibility timeout should exceed 24 hours

    Why this is the answer

    A DLQ holds messages after the maximum receive count is exceeded, while the visibility timeout hides messages currently being processed by a consumer.

  9. Question 9Interactive

    Examine the state machine snippet and identify which Step Functions feature is configured for the task state.

    • ADeclarative error handling and retriesCorrect answer
    • BInput/output JSONPath filtering
    • CDynamoDB table creation
    • DS3 lifecycle automation

    Why this is the answer

    Retry and Catch blocks handle transient service failures and route to recovery states without requiring custom exception handling code.

  10. Question 10Single Choice

    What is the default read consistency model for Amazon DynamoDB when an application does not specify one?

    • AEventually consistent readsCorrect answer
    • BStrongly consistent reads
    • CRead-after-write consistent reads
    • DCross-region consistent reads

    Why this is the answer

    DynamoDB uses eventually consistent reads by default, lowering cost and latency while allowing the possibility of stale data.

Development with AWS Services

13 questions in this domain

  1. Question 11Single Choice

    What is the primary responsibility of a Partition Key (PK) in a DynamoDB table?

    • AIt generates secondary indexes
    • BIt uses a hash function to determine the physical partition where data is storedCorrect answer
    • CIt uniquely identifies each item in a multi-Region replica
    • DIt automatically orders items by their timestamp

    Why this is the answer

    The partition key is hashed to determine which physical partition stores the item. It does not create indexes or order items on its own.

  2. Question 12Multiple Select

    Which statements about DynamoDB Global Secondary Indexes (GSIs) are true? (Select two.)

    • AGSIs can be created after the table has been createdCorrect answer
    • BGSIs must share the same partition key as the base table
    • CGSIs allow queries on attributes that are not part of the primary keyCorrect answer
    • DGSIs can only be created during initial table creation

    Why this is the answer

    Unlike LSIs, GSIs can be created at any time and may use a different partition key; they project data for querying non-primary-key attributes.

  3. Question 13Interactive

    Review the DynamoDB code snippet. What is the consequence of setting ConsistentRead to True?

    • AIt reduces the read cost of the operation
    • BIt ensures the returned item reflects the most recent writeCorrect answer
    • CIt allows reading attributes that are not part of the primary key
    • DIt enables auto-scaling for the table

    Why this is the answer

    Strongly consistent reads return the latest committed data, but they cost more and may have higher latency than eventually consistent reads.

  4. Question 14Single Choice

    In DynamoDB On-Demand mode, how is read/write capacity handled?

    • AYou must provision RCU and WCU manually
    • BIt automatically scales to accommodate sudden traffic spikesCorrect answer
    • CIt supports a maximum of 300 transactions per second
    • DIt requires a DynamoDB Streams trigger

    Why this is the answer

    On-Demand mode automatically adjusts capacity for unpredictable workloads, removing the need to manage RCU/WCU manually.

  5. Question 15Multiple Select

    Which statements about DynamoDB Streams are correct? (Select two.)

    • AThey capture a time-ordered sequence of item-level changesCorrect answer
    • BThey can trigger Lambda functions for event-driven processingCorrect answer
    • CThey automatically create Global Secondary Indexes
    • DThey are only available on tables using provisioned capacity

    Why this is the answer

    Streams capture item-level changes in time order and can invoke Lambda for event-driven architectures. They do not create indexes or depend on capacity mode.

  6. Question 16Interactive

    Given this DynamoDB update with a version condition, what happens if another process has already changed the version?

    • AThe write succeeds because conditions are optional
    • BThe write fails, preserving data integrityCorrect answer
    • CThe item is overwritten with the new version
    • DDynamoDB automatically increments the version

    Why this is the answer

    The condition expression acts as optimistic locking; if the version attribute does not match the expected value, the update is rejected.

  7. Question 17Single Choice

    According to AWS best practices, which statement about S3 Glacier retrieval is correct?

    • AAll Glacier storage classes provide instant retrieval
    • BInstant Retrieval and Flexible/Deep Archive have the same retrieval latency
    • COnly some Glacier classes are designed for instant retrieval; others take minutes to hoursCorrect answer
    • DGlacier retrieval is always measured in milliseconds

    Why this is the answer

    Glacier storage classes vary: Instant Retrieval is for rapid access, while Flexible and Deep Archive involve longer retrieval times. Do not assume uniform latency.

  8. Question 18Multiple Select

    Which S3 features help protect data against accidental deletes and optimize storage costs? (Select two.)

    • AObject Versioning to keep multiple variants of objectsCorrect answer
    • BPre-signed URLs to allow anonymous public writes
    • CS3 Lifecycle Management to transition objects to lower-cost storage classesCorrect answer
    • DBucket deletion policies to remove unused buckets automatically

    Why this is the answer

    Versioning preserves object variants and allows recovery from accidental deletes or overwrites; lifecycle rules automate transitions or expirations to reduce costs.

  9. Question 19Interactive

    Review the code for generating a URL. What does this function allow an end user to do?

    • AIt makes the object permanently public
    • BIt grants temporary access to download the object for 300 secondsCorrect answer
    • CIt allows the user to delete the object
    • DIt creates a new S3 bucket

    Why this is the answer

    A pre-signed URL grants time-limited access to a private object; here, a GET URL is valid for 300 seconds.

  10. Question 20Single Choice

    Which statement describes S3's consistency model?

    • AS3 provides strong read-after-write consistency for all applicationsCorrect answer
    • BS3 is eventually consistent for all reads
    • CS3 reads require a pre-signed URL to be consistent
    • DConsistency is only guaranteed if versioning is enabled

    Why this is the answer

    S3 now provides strong read-after-write consistency for both new PUTs and overwrites, so developers should not add unnecessary polling or propagation handling.

  11. Question 21Multiple Select

    Which S3 events can be used with S3 Event Notifications? (Select two.)

    • As3:ObjectCreatedCorrect answer
    • Bs3:ObjectRemovedCorrect answer
    • Cs3:BucketDeleted
    • Ds3:UserLoggedIn

    Why this is the answer

    S3 event notifications can be triggered by object-level events such as creation and removal, enabling event-driven workflows.

  12. Question 22Interactive

    Review the S3 Select SQL expression. What does it enable?

    • AIt replaces Amazon DynamoDB for relational queries
    • BIt filters data at the storage layer, returning only the subset to the applicationCorrect answer
    • CIt creates a secondary index on the object
    • DIt permanently deletes rows from the object

    Why this is the answer

    S3 Select uses SQL expressions to filter object data server-side, reducing network transfer and latency. It is not a replacement for database services.

  13. Question 23Single Choice

    What is the primary purpose of the SNS Fan-out pattern?

    • AIt broadcasts the same message to multiple SQS queues for parallel processingCorrect answer
    • BIt ensures strict message ordering across all queues
    • CIt replaces the need for Lambda functions
    • DIt provides exactly-once delivery to all subscribers

    Why this is the answer

    SNS fans a message out to all SQS queues simultaneously, allowing independent consumers to process the same event in parallel. The pattern does not guarantee ordering.

Security

11 questions in this domain

  1. Question 24Single Choice

    In DynamoDB, what is the primary purpose of the Sort Key within a composite primary key?

    • AOrdered grouping and range queriesCorrect answer
    • BHashing data across partitions
    • CEncrypting items at rest
    • DReplacing the partition key for all queries

    Why this is the answer

    A Sort Key enables ordered grouping of items under the same Partition Key and supports range queries using operators like begins_with or between.

  2. Question 25Multiple Select

    Which statements accurately describe DynamoDB read consistency models?

    • AEventually Consistent reads are the default and lower costCorrect answer
    • BStrongly Consistent reads return the latest dataCorrect answer
    • CStrongly Consistent reads have higher costCorrect answer
    • DStrongly Consistent reads are always the best choice

    Why this is the answer

    Eventually Consistent reads are the default and less expensive; Strongly Consistent reads return the most recent data but cost more.

  3. Question 26Interactive

    A developer uses the following DynamoDB call. What behavior does the ConditionExpression enforce?

    • AWrite only succeeds if the item key does not already existCorrect answer
    • BWrite always succeeds and overwrites the existing item
    • CWrite succeeds only if the item has never been read
    • DWrite fails if the partition key has a sort key

    Why this is the answer

    attribute_not_exists(id) makes the write atomic: the PutItem succeeds only when no item with that key exists, preventing unintended overwrites.

  4. Question 27Single Choice

    What is the intended purpose of an S3 pre-signed URL?

    • AGrant time-limited access to private objectsCorrect answer
    • BMake objects permanently public
    • CTransition objects to Glacier
    • DReplicate objects across regions

    Why this is the answer

    Pre-signed URLs grant temporary access to private S3 objects without requiring the end user to have AWS credentials.

  5. Question 28Multiple Select

    Which actions can S3 Lifecycle Management automate for developers?

    • ATransition objects between storage classesCorrect answer
    • BExpire objects after a retention periodCorrect answer
    • CTrigger Lambda on object upload
    • DProvide strong read-after-write consistency

    Why this is the answer

    S3 Lifecycle Management automates storage class transitions and object expiration to optimize cost and retention.

  6. Question 29Interactive

    Given this S3 Select query, what is the primary benefit over downloading the entire object?

    • AFilter data at the storage layer to reduce latency and bandwidthCorrect answer
    • BCreate a new S3 bucket automatically
    • CTransition the object to a colder storage class
    • DEnable versioning on the S3 bucket

    Why this is the answer

    S3 Select filters data at the storage layer before sending it to the application, reducing latency and network bandwidth.

  7. Question 30Single Choice

    What does a DynamoDB Stream capture?

    • ATime-ordered sequence of item-level changesCorrect answer
    • BRead request logs for a table
    • CA list of all IAM users
    • DA static backup stored in S3

    Why this is the answer

    DynamoDB Streams captures a time-ordered sequence of item-level changes, enabling event-driven architectures.

  8. Question 31Multiple Select

    Which statements correctly compare Step Functions Standard and Express workflows?

    • AStandard workflows are for long-running, auditable, exactly-onceCorrect answer
    • BExpress workflows are for high-volume, short-duration, at-least-onceCorrect answer
    • CExpress workflows are ideal for long-running audits
    • DStandard workflows always have lower latency than Express

    Why this is the answer

    Standard workflows provide exactly-once execution for long-running processes; Express workflows handle high-volume, short-duration tasks with at-least-once execution.

  9. Question 32Interactive

    A developer defines the following Step Functions state. What happens if the Lambda invocation fails transiently?

    • AIt is retried up to three times before falling backCorrect answer
    • BThe state immediately terminates the workflow
    • CThe workflow is converted to an Express workflow
    • DThe Lambda function is deleted automatically

    Why this is the answer

    The Retry block retries the task up to three times, and if it still fails, the Catch block routes execution to the Fallback state.

  10. Question 33Single Choice

    How is optimistic locking typically implemented in DynamoDB?

    • AVersion attribute and Conditional ExpressionsCorrect answer
    • BPre-signed URLs attached to items
    • CIncreasing read capacity units
    • DCreating a GSI on the version number

    Why this is the answer

    Optimistic locking uses a version attribute with Conditional Expressions so writes fail if the version does not match, preventing lost updates.

  11. Question 34Multiple Select

    Which statements about SQS FIFO queues are true?

    • AExactly-once processing and strict orderingCorrect answer
    • BUp to 300 TPS, or 3,000 with batchingCorrect answer
    • CNearly unlimited throughput with best-effort ordering
    • DNo message deduplication support

    Why this is the answer

    FIFO queues guarantee exactly-once processing and strict ordering, supporting 300 TPS or 3,000 with batching.

Troubleshooting and Optimization

8 questions in this domain

  1. Question 35Single Choice

    In Amazon DynamoDB, what is the primary role of the Partition Key in data distribution?

    • AIt hashes the key to select a partition.Correct answer
    • BIt groups items in sorted order.
    • CIt replicates items across Availability Zones.
    • DIt chooses the read consistency model.

    Why this is the answer

    The Partition Key is hashed by DynamoDB to determine the physical partition where the item is stored. Sort keys provide ordered grouping.

  2. Question 36Multiple Select

    Which statements about Global Secondary Indexes (GSIs) and Local Secondary Indexes (LSIs) are correct?

    • AGSIs can be created after table creation.Correct answer
    • BLSIs must be defined at table creation.Correct answer
    • CLSIs can use a different partition key.
    • DGSIs must share the base table partition key.

    Why this is the answer

    GSIs can be created anytime and use any partition key. LSIs are fixed at creation and share the base table partition key.

  3. Question 37Interactive

    Given the DynamoDB code snippet, what does the ConditionExpression ensure?

    • AUpdates only when the price attribute is absent.Correct answer
    • BIt prevents updates after item creation.
    • CIt requires a positive price value.
    • DIt deletes items with a price present.

    Why this is the answer

    The condition attribute_not_exists(price) makes the update succeed only when the price attribute is missing. This prevents overwrites atomically, avoiding a separate read-then-write step.

  4. Question 38Single Choice

    Which DynamoDB read option is most cost-effective when slightly stale data is acceptable?

    • AEventually Consistent ReadsCorrect answer
    • BStrongly Consistent Reads
    • CTransactional Reads
    • DBatch Reads

    Why this is the answer

    Eventually consistent reads are the default and use fewer resources, reducing cost and latency. Strongly consistent reads cost more and always return the latest data.

  5. Question 39Multiple Select

    Which use cases are well suited to DynamoDB Streams?

    • AReacting to item changes with a Lambda functionCorrect answer
    • BCapturing a time-ordered sequence of item-level changesCorrect answer
    • CReplacing a Global Secondary Index for queries
    • DProviding strongly consistent reads for all access

    Why this is the answer

    DynamoDB Streams capture ordered item-level changes and can trigger Lambda for event-driven workflows. They do not replace GSIs or provide read consistency.

  6. Question 40Interactive

    The following JSON defines a Step Functions state machine. Which AWS service is invoked by the Task state?

    • ALambda functionCorrect answer
    • BSQS queue
    • CDynamoDB table
    • DAPI Gateway endpoint

    Why this is the answer

    The Task state Resource ARN references an AWS Lambda function. Step Functions uses Task states to invoke services like Lambda.

  7. Question 41Single Choice

    What is the purpose of a pre-signed URL in Amazon S3?

    • ATemporary access without AWS credentialsCorrect answer
    • BMakes an object permanently public
    • CEncrypts objects at rest automatically
    • DChanges the storage class of an object

    Why this is the answer

    Pre-signed URLs provide temporary access to private objects without requiring the end user to hold AWS credentials.

  8. Question 42Multiple Select

    Which actions can be automated with S3 Lifecycle policies?

    • ATransition objects to lower-cost storage classesCorrect answer
    • BExpire objects after a retention periodCorrect answer
    • CReplicate objects across AWS Regions
    • DEncrypt objects with new keys

    Why this is the answer

    S3 Lifecycle policies automate transitions between storage classes and expiration. Cross-region replication and encryption are managed by other features.

Frequently asked questions

Everything about the AWS Certified Developer – Associate question bank and how to use it.