DP-420 sample questions with answers

10 free practice questions for the Microsoft Certified: Azure Cosmos DB AI Developer Associate exam. Try each one, then open the answer to see why the right option wins and every other option loses.

Question 1Design and develop database solutions

Datum Corporation runs a telemetry container at 30,000 RU/s of standard (manual) throughput in a single-region account. Over the last 30 days, the highest Normalized RU Consumption in each hour averaged 85 percent. Finance asks whether switching the container to autoscale with a 30,000 RU/s maximum would lower the bill. What should you recommend?

  1. A.

    Keep standard (manual) throughput, because average utilization above 66 percent means manual costs less.

  2. B.

    Switch to autoscale, because autoscale always costs less than manual throughput for a single-region account.

  3. C.

    Convert the account to serverless, because serverless is always cheaper than provisioned throughput at any utilization.

  4. D.

    Switch to autoscale, because autoscale bills only for the request units actually consumed each second.

Show answer

Answer: A

With average utilization of 85 percent, above Learn's 66 percent threshold, standard (manual) throughput remains cheaper than autoscale.

  • A. Learn's guidance is that when average hourly utilization is above 66 percent, standard throughput is cheaper than autoscale billed at 1.5 times the rate.
  • B. Autoscale is cheaper only when the maximum is fully used for about 66 percent of hours or less; at 85 percent it costs more.
  • C. Serverless suits intermittent traffic with a low average-to-peak ratio, and an existing provisioned account can't simply be converted to it.
  • D. Autoscale bills the highest RU/s scaled to in each hour at 1.5 times the manual rate; it is not consumption-based per second, which is serverless.
Question 2Design and develop database solutions

Litware is migrating from the .NET bulk executor library to bulk support in the Azure Cosmos DB .NET SDK v3. Which two statements about bulk support are correct? Each correct answer presents a complete solution. (Choose TWO.)

Choose 2.

  1. A.

    After a CosmosClient is created with bulk enabled, changing AllowBulkExecution on its options has no effect.

  2. B.

    The SDK groups concurrent point operations into single service calls, distributing them across partitions.

  3. C.

    All operations sent through bulk support are applied atomically, so one failure rolls back the others.

  4. D.

    Bulk support can only create items; replace, delete and patch operations must be sent without bulk.

  5. E.

    Bulk support ignores the retry options, so 429 responses are always returned to the application immediately.

Show answer

Answer: A, B

Bulk support groups concurrent operations into fewer service calls per partition, and the setting is fixed once the client is created.

  • A. Learn notes that once bulk execution is specified in CosmosClientOptions, it is effectively immutable for the client's lifetime.
  • B. Learn describes bulk as the client internally grouping concurrent operations into single service calls, per partition.
  • C. Bulk operations succeed or fail individually; atomicity requires a transactional batch.
  • D. Bulk works with create, upsert, replace and delete, and Learn says bulk APIs can also run patch operations.
  • E. Retries on rate-limited requests are configured through CosmosClientOptions and apply to bulk as usual.
Question 3Design and develop database solutions

A pricing service at Wide World Importers updates the /price property of product items with a patch request. If a product item has no price property, the request must fail rather than silently add the property. Which patch operation should the service use?

  1. A.

    Set, because it updates the value of an existing property

  2. B.

    Add, because it updates the value when the property already exists

  3. C.

    Replace, because it follows strict replace-only semantics

  4. D.

    Increment, because it changes the stored value in place

Show answer

Answer: C

Replace is the patch operation with strict replace-only semantics: it fails when the target path doesn't exist.

  • A. Set adds the property if it doesn't already exist, so it wouldn't fail on a missing price.
  • B. Add also creates the property when it's missing, so it can't enforce existence.
  • C. Replace fails when the target path doesn't exist, which asserts that price is always present.
  • D. Increment creates the field with the given value if it doesn't exist, and it adds rather than sets.
Question 4Design and develop database solutions

Margie's Travel must reserve a seat on a tour and add the booking to the traveler's itinerary. Both items share the tour's partition key. The two changes must succeed together, and the seat update must apply only while availableSeats is above zero, without reading the tour item first. What should the developer implement?

  1. A.

    A ReplaceItem for the tour with IfMatchEtag in a transactional batch, plus the itinerary write

  2. B.

    A client created with AllowBulkExecution that sends both patch operations concurrently

  3. C.

    A transactional batch whose PatchItem for the tour uses TransactionalBatchPatchItemRequestOptions with FilterPredicate "FROM t WHERE t.availableSeats > 0", plus the itinerary write

  4. D.

    Two separate PatchItemAsync calls, the first with a FilterPredicate on availableSeats and the second for the itinerary

Show answer

Answer: C

Put a conditional patch, using a filter predicate, inside a transactional batch, so the seat decrement and the itinerary write commit together only while seats remain.

  • A. An ETag-based replace requires reading the tour item first to build the document and obtain its ETag.
  • B. Bulk groups operations for throughput but gives no all-or-nothing guarantee.
  • C. A conditional patch inside a batch applies the seat decrement only when the predicate holds, and the batch makes both writes atomic.
  • D. Separate calls aren't atomic; the itinerary could be updated after the seat patch fails, or the reverse.
Question 5Design and develop database solutions

Alpine Ski House enabled a 7-day TTL on a telemetry container that runs close to 100 percent of its provisioned throughput all day. A week later, storage metrics show that expired items are still consuming space. A developer asks whether queries are returning those expired items. What should you tell the developer?

  1. A.

    Expired items no longer appear in reads or queries; their physical deletion is delayed until leftover request units are available.

  2. B.

    Expired items keep appearing in queries until the background task physically deletes them, so every query must add a filter on _ts.

  3. C.

    TTL can't delete items while the container runs above 80 percent utilization, so the setting has been ignored.

  4. D.

    The items were never marked as expired because TTL only applies to items created after TTL was enabled.

Show answer

Answer: A

Expired items are hidden from reads and queries at once, but the background deletion uses leftover RUs and is delayed on a fully used container.

  • A. Learn states that an expired item stops appearing in query responses immediately, and that deletion uses leftover RUs and is delayed when none are available.
  • B. Expired items are excluded from reads and query results even before they are physically deleted.
  • C. There is no utilization cut-off; deletion is delayed, not disabled, when RUs are scarce.
  • D. TTL applies to all items based on their last modified time, including items written before TTL was enabled.
Question 6Design and develop database solutions

A mobile back end at Wingtip Toys caches product items in memory together with each item's _etag. Before serving a cached product, it must check with Azure Cosmos DB whether the item has changed and download the item again only if it has. Which request option should it send with the read?

  1. A.

    ConsistencyLevel set to Strong so that the cached copy is always current

  2. B.

    IfNoneMatchEtag set to the cached _etag value

  3. C.

    SessionToken set to the value returned when the item was cached

  4. D.

    IfMatchEtag set to the cached _etag value

Show answer

Answer: B

A read with IfNoneMatchEtag set to the cached ETag lets the service indicate that the cached copy is still current, so the item is fetched only when it changed.

  • A. Consistency affects which version a read returns, not whether the cached copy needs to be downloaded again.
  • B. Learn describes using _etag with the if-none-match header to determine whether a refetch of a resource is needed.
  • C. A session token enforces read-your-writes for a session; it doesn't make the read conditional on a change.
  • D. If-Match guards writes against concurrent changes; it doesn't express 'only return the item if it changed'.
Question 7Design and develop database solutions

Nod Publishers is considering a serverless Azure Cosmos DB for NoSQL account for a new reading-list service. Which two statements about serverless accounts are correct? Each correct answer presents a complete solution. (Choose TWO.)

Choose 2.

  1. A.

    Each physical partition of a serverless container can serve up to 5,000 RU/s, so the container's maximum throughput depends on its partition count.

  2. B.

    An existing serverless container can be switched to autoscale from its Scale & Settings pane.

  3. C.

    You can't create a database with shared throughput in a serverless account.

  4. D.

    Burst capacity can be enabled so that serverless containers bank idle capacity for spikes.

  5. E.

    Priority-based execution can be used to throttle low priority requests on serverless containers first.

Show answer

Answer: A, C

Serverless containers scale at up to 5,000 RU/s per physical partition and take no throughput settings, so shared throughput databases, burst capacity and priority-based execution are unavailable.

  • A. Learn states that a serverless container begins at 5,000 RU/s and that each physical partition can handle up to 5,000 RU/s, so the maximum depends on the number of physical partitions.
  • B. You can't read or update throughput on a serverless container; the capacity mode is chosen when the account is created.
  • C. Serverless containers take no throughput setting at all, and creating a shared throughput database returns an error.
  • D. Burst capacity applies only to provisioned throughput accounts, manual or autoscale, not to serverless.
  • E. Priority-based execution is not supported for serverless accounts.
Question 8Design and develop database solutions

Southridge Video's watch-list page must load about 40 videos whose id and partition key values are already known. The videos are spread across many logical partitions, and the page must load with the lowest latency. What should the developer use?

  1. A.

    Container.ReadManyItemsAsync with the list of id and partition key pairs

  2. B.

    Forty sequential ReadItemAsync calls, each awaited before the next one starts

  3. C.

    A query with WHERE v.id IN (...) that lists all 40 ids, with cross-partition query enabled

  4. D.

    A change feed iterator started from the beginning of the container and filtered in memory

Show answer

Answer: A

ReadManyItemsAsync fetches a set of known id and partition key pairs and is designed to have lower latency than an equivalent IN query.

  • A. ReadManyItemsAsync looks up many items by id and partition key and is designed to beat an IN query on latency.
  • B. Serial round trips add up the latency of 40 requests, the opposite of the goal.
  • C. An IN query is the approach ReadManyItemsAsync is designed to outperform for fetching many independent items.
  • D. The change feed reads every change in the container; it isn't a lookup mechanism for known keys.
Question 9Design and develop database solutions

Olympia Bank sets an autoscale maximum of 40,000 RU/s on an Azure Cosmos DB for NoSQL container. During one hour the container receives no requests at all. For how much throughput is that hour billed?

  1. A.

    400 RU/s, the minimum throughput of any provisioned container

  2. B.

    4,000 RU/s, which is 10 percent of the maximum

  3. C.

    0 RU/s, because autoscale bills only for request units consumed

  4. D.

    40,000 RU/s, because autoscale bills the maximum every hour

Show answer

Answer: B

Autoscale scales between 10 percent of the maximum and the maximum, so an idle hour is billed at 4,000 RU/s.

  • A. 400 RU/s is the minimum for standard (manual) containers, not the floor of this autoscale range.
  • B. Autoscale scales between 0.1 x Tmax and Tmax, so an idle hour is billed at 4,000 RU/s.
  • C. Autoscale always bills at least 10 percent of the maximum for each hour; zero-cost idle hours belong to serverless.
  • D. Autoscale bills the highest RU/s reached in each hour, not the configured maximum.
Question 10Design and develop database solutions

Humongous Insurance runs an Azure Cosmos DB for NoSQL account in East US with Strong as the default consistency level. An administrator tries to add Australia East as a read region, roughly 15,000 kilometers away, and the operation is blocked. What explains the behavior?

  1. A.

    Strong consistency is blocked by default for accounts whose regions span more than 8,000 kilometers, because of high write latency; enabling it requires contacting support.

  2. B.

    Strong consistency supports at most two regions per account, so adding any further region is rejected until the default level is lowered.

  3. C.

    A read region must be in the same Azure geography as the write region for any consistency level stronger than Session.

  4. D.

    Accounts with Strong consistency must enable multiple write regions before a read region can be added.

Show answer

Answer: A

Strong consistency is blocked by default for regions more than 5,000 miles (8,000 km) apart because every write must commit in all regions.

  • A. Learn documents this default block: Strong over very large distances makes every write wait for the far region, so it is disabled unless support enables it.
  • B. No two-region cap exists for Strong; dynamic quorum is even described for accounts with three, four or five regions.
  • C. Bounded staleness is widely used across geographies, and Strong is limited by distance, not by a geography boundary.
  • D. The reverse is true: multiple write regions cannot be combined with Strong consistency at all.

Keep going with 502 more DP-420 questions

Free papers every day, in the real exam formats, with progress by exam domain. Unlock every paper and timed mock exam when you are ready.

DP-420 sample questions with answers (10 free) · CertifyCloudx