12 DP-420 Scenarios, Sorted by Difficulty
DP-420 (Designing and Implementing Cloud-Native Applications Using Microsoft Azure Cosmos DB) rewards knowing which mechanism fits a scenario — partition key design, consistency level, change feed, or RU optimization — not memorized definitions. These 12 questions are split into Easy, Medium, and Hard tiers so you can gauge exactly where your gap is before booking the exam.
If you clear the Easy tier but stumble in Medium, focus your remaining study time on Change Feed patterns, indexing policy, and multi-region conflict resolution. If Hard is where you lose points, that is almost always RU-cost reasoning, hierarchical partition keys, or the RBAC-vs-keys distinction — the three topics candidates most often report skipping because they feel like "operations," not "development."
For the full domain breakdown and study plan, see the DP-420 study guide.
Easy — Foundational Cosmos DB Decisions
A telemetry application ingests readings from 50,000 IoT devices. Each device writes a new reading every few seconds, and the application almost always queries by deviceId to get a device's recent history. Which property makes the best partition key?
Reveal Answer & Explanation
Correct Answer: A
A synthetic key like deviceId_date spreads writes across more logical partitions than deviceId alone (which would create one hot partition per device as reading volume grows) while still allowing efficient single-partition queries scoped to a device and date range. deviceId alone (B) is a reasonable starting point but becomes a throughput bottleneck as a single device's reading volume grows within one logical partition's RU limit. Timestamp (C) would scatter a single device's history across many partitions, making the most common query cross-partition and expensive. A random GUID (D) maximizes write distribution but makes every device-history query cross-partition — the opposite of what the access pattern needs.
A retail application needs read latency in single-digit milliseconds and can tolerate reading data that is a few writes behind, but a single client's own reads must always reflect its own prior writes. Which default consistency level fits without any application-side changes?
Reveal Answer & Explanation
Correct Answer: B
Session consistency guarantees read-your-own-writes and monotonic reads within a single client session, at latency and availability close to Eventual — matching "low latency" plus "my own writes must be visible to me" without extra configuration. Strong (A) guarantees linearizability but at the highest latency and lowest availability of the five levels, more than this scenario needs. Bounded Staleness (C) bounds how stale reads can get but does not specifically guarantee a session's own writes are visible sooner than the staleness window. Eventual (D) offers no read-your-own-writes guarantee at all, which the scenario explicitly requires.
A .NET application connects to Azure Cosmos DB for NoSQL from inside an Azure Virtual Machine in the same region as the Cosmos DB account, and wants the lowest possible network latency per request. Which connectivity mode should the client use?
Reveal Answer & Explanation
Correct Answer: C
Direct mode connects the client straight to the backend replica over TCP, skipping the gateway hop, and gives the lowest latency when client and account are in the same region — the standard recommendation for performance-sensitive workloads. Gateway mode (A) proxies every request through a gateway service; it works everywhere (including from networks that block non-HTTPS ports) but adds a hop, so it is not the lowest-latency option. "HTTP/1.1 mode" (B) is not a real Cosmos DB SDK connectivity mode. Bypassing the SDK (D) would mean re-implementing retry, partition routing, and session-token handling yourself — not a supported performance optimization.
A container stores shopping cart documents that should be automatically deleted 24 hours after their last update, without any application code running a cleanup job. Which feature should you configure?
Reveal Answer & Explanation
Correct Answer: D
Time to live is a built-in Cosmos DB feature: set a default TTL in seconds on the container (86400 for 24 hours), and Cosmos DB automatically deletes expired items in the background with no application code or extra compute. A stored procedure (A) and a scheduled Function (B) both require you to write and operate cleanup logic Cosmos DB already provides natively. Change Feed (C) is for reacting to changes, not for expiring items — using it for deletion is solving the problem the hard way when a native feature exists.
Halfway through
The Medium and Hard tiers are where DP-420 actually differs from DP-900
40 free practice questions, same difficulty range, no credit card required.
Start Free Practice →Medium — Applied Design Decisions
An e-commerce platform stores orders in one container and needs a denormalized "customer order summary" document kept in sync in a second container every time an order is created or updated, without the order-writing service knowing anything about the summary container. Which approach fits?
Reveal Answer & Explanation
Correct Answer: A
Change Feed plus an Azure Functions trigger is the documented Cosmos DB pattern for denormalizing data across containers reactively and asynchronously, decoupling the order-writing service from anything about the summary container. Option C couples the two containers directly in application code, which is exactly what the scenario says to avoid. A stored procedure (B) runs within a single container/partition transaction scope and cannot write to a different container. A daily batch job (D) does not meet "kept in sync... every time an order is created or updated" — it introduces up to 24 hours of staleness.
A container has documents with a large "internalNotes" array that is never queried but is included by default in every automatically-indexed property, inflating write RU cost. What is the most direct fix?
Reveal Answer & Explanation
Correct Answer: B
Cosmos DB indexes every property by default; excluding a specific path in a custom indexing policy stops that property from being indexed, directly reducing the RU cost of writes that include it, while leaving everything else indexed and queryable as before. Moving the field to another container (A) is a data-model change with much larger blast radius than adjusting an indexing policy. Lazy indexing (C) is a deprecated/legacy option that trades consistency of query results for indexing cost, not a targeted fix for one property. Reducing throughput (D) does not reduce the RU cost of an operation — it reduces the RUs available, which would cause throttling instead.
A globally distributed Cosmos DB account accepts writes in three regions. Two regions write conflicting updates to the same item at nearly the same time, and the application has specific business logic for resolving exactly this kind of conflict. What should you configure?
Reveal Answer & Explanation
Correct Answer: C
Cosmos DB for NoSQL supports a custom conflict resolution policy that runs a stored procedure you write, letting you encode arbitrary business logic for merging or choosing between conflicting versions — exactly what "specific business logic for resolving exactly this kind of conflict" calls for. Last-writer-wins (A) is Cosmos DB's default and simplest policy, but it is not customizable business logic — it is a plain fallback. Strong consistency (B) is not supported across multiple write regions in Cosmos DB and would not eliminate multi-region write conflicts even if it were. Removing multi-region writes (D) would solve the conflict problem but was ruled out by the scenario's premise of an account that "accepts writes in three regions" as a requirement.
A healthcare application must be able to restore a container to its exact state at any specific second within the past 7 days, for compliance investigations. Which backup configuration meets this?
Reveal Answer & Explanation
Correct Answer: D
Continuous backup with point-in-time restore is the Cosmos DB feature specifically designed to restore to any point within the retention window (up to 7 or 30 days depending on tier), satisfying "any specific second." Periodic backup (A) only lets you restore to the fixed intervals it captured — 4-hour intervals cannot hit an arbitrary second. A daily export (C) has the same granularity problem, worse. GRS (B) protects against regional storage failure and does not provide point-in-time restore to an arbitrary timestamp at all.
Hard — Multi-Region, Performance, and Access Control
A query joins data across three logical partitions using a cross-partition query without a partition key filter, and its RU cost is unexpectedly high. A developer rewrites part of the query as a correlated subquery against an array property within each document instead of a JOIN across the whole container. What is the primary reason this can reduce RU cost?
Reveal Answer & Explanation
Correct Answer: A
A correlated subquery in Cosmos DB's SQL dialect operates on a nested array or property within a single document being evaluated — it never needs to fan out and merge results across containers or partitions the way a true JOIN-style cross-partition operation does, so its RU cost stays much closer to the cost of evaluating one document. Consistency level (B) has no bearing on subquery RU cost — that is a separate dimension entirely. Correlated subqueries do not add a partition key filter automatically (C); if the outer query still lacks one, it is still cross-partition. Every operation in Cosmos DB is RU-charged (D); nothing bypasses RU accounting.
A container uses tenantId as its partition key, but one large enterprise tenant now generates more traffic than a single logical partition's throughput ceiling allows, while every other tenant fits comfortably. Which design change addresses this without splitting the enterprise tenant into a separate container?
Reveal Answer & Explanation
Correct Answer: B
A hierarchical partition key lets you combine tenantId with a second property (such as a resource type or date bucket) so a single large tenant's data spreads across multiple physical partitions internally while still supporting efficient tenantId-scoped queries — this is the documented fix for exactly this "one hot tenant" problem. Switching the whole container to a random GUID (A) would fix the hot-partition problem but destroy the ability to efficiently query by tenant for every other tenant too — a much bigger change than needed. Raising throughput (C) does not help: a single logical partition has its own throughput ceiling regardless of how much total RU/s the container is provisioned with. Serverless mode (D) does not remove the per-logical-partition throughput ceiling either.
A financial application must let a reporting service read Cosmos DB data without ever having access to the account's primary or secondary keys, and access must be revocable per identity through Azure's standard identity system. What should you configure?
Reveal Answer & Explanation
Correct Answer: C
Data plane RBAC with Microsoft Entra ID lets you grant a managed identity scoped, revocable permissions to read (or write) Cosmos DB data without that identity ever holding an account key, which is exactly "never having access to the primary or secondary keys" plus per-identity revocability. Rotating keys (A) still relies on keys existing and being distributed, and does not provide per-identity revocation. Resource tokens (B) are still derived from account keys and add operational complexity without meeting the "never has key access" requirement in the same way Entra ID RBAC does. Storing a key in an environment variable (D) still gives the process access to a key — the opposite of the stated requirement.
An order-processing service must update three related items — an order, an inventory count, and a customer loyalty-points balance — as a single all-or-nothing transaction, and all three items share the same partition key. Which implementation meets the atomicity requirement?
Reveal Answer & Explanation
Correct Answer: D
Cosmos DB stored procedures execute within the scope of a single logical partition as one atomic transaction: all writes inside the procedure commit together, or none do, if the items share a partition key — which they do here. Three separate SDK calls (A) are three independent operations; a try/catch does not undo the ones that already succeeded if a later one fails. Bulk Support (C) is designed for high-throughput independent operations, not atomicity — a failure in one operation does not roll back the others. Chaining separate Azure Functions with Durable Functions (B) can achieve eventual/compensating consistency (a saga pattern) but that is different from true atomic, all-or-nothing transactional behavior in one commit.
If You Missed More Than 2-3 Questions
A miss rate above 2-3 out of 12 is a signal, not a verdict — where it clusters tells you what to study next, and it clusters differently depending on your background:
Missed mostly Easy or Medium questions
You likely need more hands-on time with the SDK itself — connectivity modes, TTL, and Change Feed are implementation mechanics, not abstract concepts, and reading about them is not the same as having configured them.
Missed mostly Hard questions
You know the mechanics but not the tradeoffs. RU-cost reasoning, hierarchical partition keys, and RBAC-vs-keys all require comparing two or more valid-sounding options against a specific constraint in the scenario — worth extra timed practice, not just re-reading definitions.
These 12 Are a Sample of 500
MSCertQuiz DP-420 covers all 5 domains in practice mode and a timed exam simulation.
40 questions free to start — no credit card required.
Start Free Practice →