Microsoft Azure Cosmos DB Developer Specialty (DP-420) · Difficulty

Hard DP-420 practice questions

Challenge — multi-step scenarios, trade-offs, and subtle distinctions. 20 hard questions available — no sign-up, always free.

Question 1 of 20

You maintain a Cosmos DB container named 'orders' partitioned by /customerId. A reporting dashboard runs the query SELECT VALUE MAX(c.orderTotal) FROM c to display the single largest order value across all customers. The dashboard runs this query once every few seconds and RU consumption has become a concern. Which approach reduces the RU cost of repeatedly obtaining this value most effectively?

Reviewed for accuracy · Report an issue
Question 2 of 20

A retail analytics team enables Azure Synapse Link on a Cosmos DB for NoSQL container. The transactional data must be purged after 30 days to control storage costs, but the data science team needs to query up to 2 years of historical data through the analytical store via Synapse serverless SQL pools. How should the team configure retention to meet both requirements?

Reviewed for accuracy · Report an issue
Question 3 of 20

You are building an audit-and-replication pipeline on a Cosmos DB for NoSQL container. The downstream system must observe every intermediate change to each item — including updates that happened between reads — and must also be notified when items are deleted (so it can remove them from a search index). You will consume the change feed using the .NET SDK with the change feed processor. Which change feed configuration meets these requirements?

Reviewed for accuracy · Report an issue
Question 4 of 20

You built a change feed consumer using the .NET SDK's change feed processor to project order events into a downstream reporting container. To maximize throughput, you configured the processor to checkpoint only after every 500 processed changes rather than after each batch. During a load test, the host process crashed unexpectedly. When the processor restarts, what behavior should you expect, and what is the primary trade-off of your checkpoint configuration?

Reviewed for accuracy · Report an issue
Question 5 of 20

You are building a .NET consumer using the change feed processor from the Cosmos DB SDK to process an order-events container. During peak hours, a single processor host cannot keep up, and the change feed estimator reports growing lag. Your monitored container has 6 physical partitions. You deploy 3 additional identical instances of the same application (4 total), all configured with the same processor name, the same lease container, and the same instance-specific 'instanceName'... except two instances were accidentally deployed with an identical 'instanceName'. What is the effect on lease (partition) distribution and processing?

Reviewed for accuracy · Report an issue
Question 6 of 20

A retail catalog container stores product documents, each with a nested 'reviews' array containing objects like { rating, verified, text }. A developer needs a query that returns each product's id and title along with only the count of reviews that have a rating of 5 AND verified = true. The team wants to minimize RU charge by avoiding returning the full reviews array to the client and by evaluating the filter server-side. Which SQL query approach best meets these requirements?

Reviewed for accuracy · Report an issue
Question 7 of 20

You maintain an Azure Cosmos DB for NoSQL container storing customer orders, partitioned by /customerId. Each order document contains an array named items, where each element has a productId and quantity. A reporting service must return, for a single specified customerId, the number of distinct products that customer has ever ordered across all their order documents. You want the most RU-efficient query that returns a single scalar value. Which query approach should you use?

Reviewed for accuracy · Report an issue
Question 8 of 20

A gaming company stores telemetry in a Cosmos DB container partitioned by /gameId. One extremely popular game generates over 40 GB of telemetry for its single gameId value, and writes for that game are now failing. The team wants to keep gameId as the primary way to group data while resolving the storage ceiling. Which redesign best addresses the problem?

Reviewed for accuracy · Report an issue
Question 9 of 20

You are designing a Cosmos DB container for a logistics platform that stores shipment events. Each shipment belongs to a specific carrier, and there are only 8 carriers. Within a carrier, events are queried almost exclusively by shipmentId. The largest carrier will generate roughly 400 GB of event data over the container's lifetime. Most read queries filter by both carrierId and shipmentId, while a nightly report scans all events for a single carrier. Which partitioning strategy best balances query efficiency and avoids exceeding logical partition limits?

Reviewed for accuracy · Report an issue
Question 10 of 20

A retail analytics team enabled the integrated cache via a dedicated gateway to reduce RU charges on a set of frequently repeated queries. Most queries now return RU charge of 0, but one high-volume query keeps showing full RU cost on every execution even though it is identical each time. Investigation shows the SDK client for that query sets the request consistency level to Strong, while the account default is Session. What is the most likely cause of the cache never being used for that query?

Reviewed for accuracy · Report an issue
Question 11 of 20

Your team enabled the Azure Cosmos DB integrated cache by provisioning a dedicated gateway and routing the .NET SDK client through gateway mode with the dedicated gateway endpoint. A frequently repeated query still shows full RU charges on most executions rather than the expected near-zero cost. Investigation reveals the application sets the request consistency level to Strong on each query. What is the most likely reason the integrated cache is not serving these queries?

Reviewed for accuracy · Report an issue
Question 12 of 20

A logistics company runs a globally distributed Cosmos DB account with multi-region writes enabled across four regions. Their shipment-tracking documents are frequently updated concurrently in different regions, and business rules require that when two updates conflict, the conflicting values must be merged into a single document by keeping the highest recorded package weight and concatenating the two status notes. Simple last-writer-wins behavior is not acceptable. Which conflict resolution configuration should they implement?

Reviewed for accuracy · Report an issue
Question 13 of 20

Your team runs a production Azure Cosmos DB for NoSQL container provisioned with autoscale at a maximum of 10,000 RU/s. Users report intermittent HTTP 429 responses during peak hours, yet the total RU/s consumed across the account stays well below the 10,000 RU/s ceiling in Azure Monitor. Which metric should you examine first to confirm the most likely root cause of the throttling?

Reviewed for accuracy · Report an issue
Question 14 of 20

A blog platform stores each Post document and separate Comment documents, all partitioned by postId in the same container. Product wants each Post to display a commentCount without running an aggregate query on every page load. You need the commentCount on the Post to stay accurate whenever a comment is inserted, and the update must occur within the same logical operation. Which approach best satisfies this requirement?

Reviewed for accuracy · Report an issue
Question 15 of 20

A developer notices that a frequently executed query filtering on 'c.status = "active"' has a high RU charge. Using the Query Metrics from the SDK response, they observe that the 'Index Hit Document Count' is much lower than the 'Retrieved Document Count', and 'Index Lookup Time' is minimal while 'Document Load Time' dominates. What is the most likely cause and appropriate remediation?

Reviewed for accuracy · Report an issue
Question 16 of 20

You are designing a Cosmos DB data model for a blogging platform. Each author writes many blog posts (an author can have thousands of posts). Author profile data (display name, bio, avatar URL) changes rarely, but when it does change it must be reflected consistently everywhere. Blog posts are read very frequently, and queries almost never need the full author bio — only the display name is shown next to each post. Which modeling approach best balances read performance and update consistency?

Reviewed for accuracy · Report an issue
Question 17 of 20

A financial services team is configuring an Azure Cosmos DB account that must be deployed across three Azure regions (East US, West Europe, and Southeast Asia). Their compliance team demands that every read return the most recent committed write with a linearizable guarantee. During design, an architect proposes enabling multi-region writes so that clients in each region write to their nearest region for lower write latency. What should you advise the team?

Reviewed for accuracy · Report an issue
Question 18 of 20

You maintain a Cosmos DB for NoSQL container of blog posts. Each document has a 'tags' array (up to 50 string entries) and a 'comments' array (up to 200 nested objects, each with an 'author' and 'likes' property). A dashboard query must return each post's title plus only the comments where 'likes' is greater than 100. The current query uses JOIN over the comments array and filters in the WHERE clause, but it returns a Cartesian-product row per matching comment and consumes high RU. What is the most efficient way to rewrite the query so each post yields a single result with the filtered comments?

Reviewed for accuracy · Report an issue
Question 19 of 20

A logistics company stores shipment events in a Cosmos DB container. Each event has a warehouseId (only 8 distinct values, causing hot partitions) and a timestamp. Most queries filter by warehouseId AND a date range (e.g., all events for a warehouse in a given month). The team wants to spread writes more evenly while still allowing efficient date-range queries scoped to a single partition. Which partition key design best meets these needs?

Reviewed for accuracy · Report an issue
Question 20 of 20

You are designing a Cosmos DB container for an IoT telemetry workload. Devices write readings continuously, and there are only 12 device types. You initially chose deviceType as the partition key, but during load testing you observe severe throttling (429 errors) concentrated on a few logical partitions, while total provisioned throughput is far from being consumed. The application always queries telemetry filtered by a specific deviceType over a time range. Which change to the partition key strategy best resolves the hot-partition problem while keeping queries efficient?

Reviewed for accuracy · Report an issue