DVA-C02 domain - 32% of the exam

Development with AWS Services

Development with AWS Services is 32% of the DVA-C02 exam. These are the objectives it covers, each with practice questions, with every answer explained.

The domain in numbers

117
Practice questions
10
Objectives
80
Medium
37
Hard

Where people go wrong

  • Retrying in lockstep without jitter

    The wrong answers use a fixed delay, a shorter delay, immediate retries or more attempts, or double the wait with no randomness. Every client then computes the same delay, so throttled DynamoDB calls collide again in waves. Exponential backoff with random jitter makes each client wait a different, growing interval, which spreads the retries. The AWS SDK applies backoff with jitter to throttling errors by default, and full jitter picks a uniform random wait between zero and the capped exponential value.

    See it in a sample question
  • Expecting queue or transaction features to deduplicate a write

    The wrong answers reach for reserved concurrency, a transaction, FIFO ordering, a dead-letter queue or a longer visibility timeout to stop a duplicate. None of them recognises a repeat of the same logical request: a transaction commits once per delivery, and a FIFO deduplication window lasts only five minutes. The correct answer derives a deterministic key, such as an idempotency key, order identifier or object key, and writes with attribute_not_exists, so the repeat fails the condition.

    See it in a sample question
  • Treating FilterExpression as a read-cost control

    The wrong answers use a FilterExpression on a Query, or a Scan with a filter, to cut the read capacity a lookup consumes. A filter runs after the items are read, so DynamoDB still consumes read capacity for every item read before the filter. Narrowing has to happen in the key: a sort-key range or begins_with in the key condition, a local secondary index with an alternate sort key, or a global secondary index that puts the status attribute in the key condition. A ProjectionExpression trims returned attributes, not items read.

    See it in a sample question
  • Using a local secondary index when the partition key must change

    The wrong answers offer a local secondary index when the access pattern needs a different partition key. A local secondary index shares the base table's partition key, so it cannot list premium users across partitions, query by warehouseId or group trips by driverId, and it stays on the same hot partition. A global secondary index has its own partition key. An INCLUDE projection on it can serve a query without a base-table fetch.

    See it in a sample question
  • Applying one event source's failure handling to another

    Each wrong option borrows a failure mechanism from a different event source. A redrive policy with maxReceiveCount belongs to an SQS queue, so it does not exist for a Kinesis stream or a DynamoDB stream. A Lambda dead-letter queue serves asynchronous invocations, and an on-failure destination does not cover an SQS mapping batch. For an SQS source, the queue's own redrive policy moves the failing message to a dead-letter queue. A stream mapping bounds the poison record with BisectBatchOnFunctionError, MaximumRetryAttempts and MaximumRecordAgeInSeconds, and sends it to an on-failure destination.

    See it in a sample question

Objectives in this domain

What to study

The official documents this domain's practice questions cite most.

Sample questions from this domain

Free sampleDevelopment with AWS Serviceshard

A batch job runs many threads that each call a DynamoDB write, and under load the calls return ProvisionedThroughputExceededException. The developer adds a fixed two-second delay before every retry, but throughput stays poor because all threads retry in lockstep and collide again. Which retry strategy resolves the synchronised collisions most effectively?

  • AApply pure exponential backoff without jitter so the wait doubles each attempt and the gap between retries grows large enough to clear the throttle.
  • BApply exponential backoff with random jitter so each thread waits a randomised, growing interval and the retries spread out instead of colliding together. Correct
  • CRaise the SDK maxRetries value so the client keeps retrying the throttled write many more times until DynamoDB eventually accepts each request.
  • DShorten the fixed delay to a few milliseconds so throttled threads retry sooner and finish the batch before the throttle window can reset itself.
Combine exponential backoff with random jitter to disperse synchronised retries that would otherwise repeatedly collide under throttling. Throttled clients that all back off by the same amount retry at the same instant and collide again, so adding random jitter to an exponentially growing delay decorrelates the retry times and lets the requests succeed gradually instead of in a thundering herd.

Why A is wrong: Doubling the wait helps somewhat, but without jitter every thread still computes the same delay and retries in lockstep, so the synchronised collisions persist.

Why B is correct: Jitter randomises each thread's wait while exponential growth eases pressure, so the threads no longer retry at the same instant and the throttling collisions disperse.

Why C is wrong: More retries with the same fixed delay only adds more synchronised attempts, which deepens the contention rather than spreading the load out over time.

Why D is wrong: A shorter fixed delay makes the lockstep retries hit even faster and harder, so the table throttles more aggressively rather than clearing the backlog.

Free sampleDevelopment with AWS Serviceshard

A payments service exposes a POST endpoint behind API Gateway and AWS Lambda. Mobile clients retry the call on a timeout, so the same charge can arrive several times. The developer must guarantee that a duplicate request never creates a second charge, even when the underlying write succeeds but the response is lost. Which approach makes the operation idempotent?

  • ARequire the client to send a unique idempotency key, then conditionally write the charge keyed on that token in DynamoDB so a repeated key is rejected. Correct
  • BConfigure the Lambda function with reserved concurrency of one so only a single charge request can run at any moment and duplicates wait their turn.
  • CEnable an API Gateway stage cache so a repeated POST returns the cached response instead of invoking the Lambda function a second time for the charge.
  • DWrap the charge in a DynamoDB transaction so the write either fully commits or rolls back and concurrent retries cannot both partially apply the charge.
Achieve idempotency for retried writes by recording a client idempotency key with a conditional write that rejects duplicates. Idempotency requires the server to recognise a repeated logical request, so storing a client-supplied idempotency token and using a condition expression that fails when the token already exists means only the first attempt writes the charge while every retry is safely rejected.

Why A is correct: A client idempotency key stored with a conditional write means the first request commits and any retry with the same key fails the condition, so the charge happens exactly once.

Why B is wrong: Reserved concurrency serialises invocations but does not deduplicate them, so two retries of the same charge still run one after another and each writes a separate record.

Why C is wrong: API Gateway caching applies to GET responses and a short TTL, so it cannot reliably suppress repeated POST writes and is not a correctness control against duplicate charges.

Why D is wrong: A transaction gives atomicity for one request but does not detect that a later retry is the same logical charge, so each retry still commits its own transaction.

Free sampleDevelopment with AWS Serviceshard

A developer models a customer and that customer's many orders in one DynamoDB table to fetch a customer profile and all their orders in a single Query. The partition key is set to CUSTOMER#<id> for every related item. The sort key must let one Query return the profile item plus all order items for that customer, while also allowing a Query that returns only the order items. How should the developer design the sort key values?

  • AStore the profile with sort key PROFILE and each order with a prefixed value such as ORDER#<orderId>, then Query the partition and use begins_with on the sort key to select orders. Correct
  • BGive the profile and every order the identical sort key value ORDER, so all items for a customer share one sort key and a single Query returns the whole group together.
  • CPut orders in a separate table keyed on orderId and join them to the profile in the application after two Query calls, one per table, on every profile request.
  • DUse a numeric sort key that increments per item and rely on a FilterExpression matching an itemType attribute to separate the profile from the order items after the read.
Model one-to-many relationships in a single partition using prefixed sort keys so one Query returns the group and begins_with selects a subtype. Sharing a partition key groups related items, and prefixed sort keys such as PROFILE and ORDER#<id> keep each item unique while letting a single Query read the whole partition. A begins_with condition on the prefix returns just the orders without scanning or filtering.

Why A is correct: Distinct prefixed sort keys keep items unique, let one Query return the whole partition, and let begins_with(ORDER#) return only the order items efficiently.

Why B is wrong: Identical sort keys collide because partition and sort key together must be unique, so the items cannot coexist and orders could not be distinguished.

Why C is wrong: Splitting tables defeats the single-Query goal and adds a second round trip, which is the inefficiency single-table design is meant to avoid here.

Why D is wrong: A FilterExpression runs after items are read, so it still consumes read capacity for filtered items and does not let begins_with target only orders.

Free sampleDevelopment with AWS Serviceshard

A table keyed on userId stores user profiles. A reporting feature must list all users whose accountTier attribute equals 'premium', and only a small fraction of users are premium. The team wants the lowest read cost and the smallest index footprint. Which approach should the developer take?

  • ARun a Scan over the base table with a filter expression on accountTier and accept reading every profile on each report run.
  • BCreate a sparse global secondary index on accountTier so only items that carry that attribute appear, then Query the index for premium. Correct
  • CAdd a local secondary index using accountTier as the alternate sort key so premium users can be queried within each userId partition.
  • DCreate a global secondary index that projects all attributes and includes every user item regardless of their accountTier value.
Use a sparse global secondary index to query a rare attribute value with low read cost and a small index size. DynamoDB only writes an item into a global secondary index when the item has the index's key attribute, so indexing accountTier produces a sparse index holding only tagged users, letting a Query target premium accounts without scanning the full table.

Why A is wrong: A Scan reads every profile and only then filters, so it consumes read capacity proportional to all users even though premium users are a small minority.

Why B is correct: A sparse global secondary index only contains items that have the indexed attribute, so it stays small and a single Query returns just the premium users cheaply.

Why C is wrong: A local secondary index keeps userId as the partition key, so it cannot list premium users across all partitions in one Query as the report requires.

Why D is wrong: A dense global secondary index that indexes every user duplicates the whole table, wasting storage when only a small premium subset is ever queried.

Free sampleDevelopment with AWS Servicesmedium

A Lambda function reads from an Amazon Kinesis Data Streams shard through an event source mapping. A single corrupted record at the front of a batch causes the function to throw, and because Lambda retries the whole batch the same record blocks all later records on that shard. The developer wants throughput to continue while still capturing the bad record. Which event source mapping setting best addresses this?

  • AIncrease the parallelization factor on the event source mapping so additional concurrent pollers move past the corrupted record on the shard.
  • BSet BisectBatchOnFunctionError with an on-failure destination so the batch is split toward the failing record and that record is reported. Correct
  • CEnable a standard SQS dead-letter queue on the source stream so Kinesis moves the corrupted record off the shard automatically after retries.
  • DReduce the batch size to one record per invocation so the corrupted record fails in isolation and every other record always succeeds.
Combine BisectBatchOnFunctionError with an on-failure destination so a poison record in a stream is isolated and captured without blocking the shard. For stream event source mappings Lambda retries a failing batch in order, so enabling bisect-on-error splits the batch to isolate the failing record and an on-failure destination receives its metadata, letting the remaining records progress instead of stalling behind the poison record.

Why A is wrong: The parallelization factor adds concurrency per shard but each lane still retries its own failing batch, so the corrupted record continues to block its records rather than being skipped.

Why B is correct: Bisecting on error narrows retries down to the single poison record, and an on-failure destination captures it, so the rest of the shard's records continue to be processed.

Why C is wrong: Kinesis streams have no per-record dead-letter queue redrive like SQS, so this setting does not exist for the source and cannot offload the corrupted record.

Why D is wrong: A batch size of one isolates the record but still retries it until the data expires, blocking that position, and it sharply increases invocation count and cost.

Other domains in this exam

See also the DVA-C02 cert hub, the study guide, and the cheat sheet.

Examworthy is not affiliated with or endorsed by Amazon Web Services. Original, blueprint-aligned practice material only.