Design and implement data models
Drill 20 practice questions focused entirely on Design and implement data models for the Microsoft DP-420 exam. Tap an answer for instant feedback and a full explanation — no sign-up, always free.
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?
You maintain a Cosmos DB container of blog posts where each document has a 'tags' property that is an array of strings, for example ["azure", "cosmosdb", "nosql"]. Your application must return all posts that include the tag "azure" anywhere in the array. You want a single SQL query expression that correctly filters these documents. Which WHERE clause should you use?
You manage a Cosmos DB container for an e-commerce catalog. Traffic is highly variable: it sits near 800 RU/s for most of the day but spikes to roughly 9,000 RU/s for two to three unpredictable hours during flash sales. The team wants to avoid throttling during spikes while minimizing cost during idle periods, and they do not want to manually adjust throughput or write scaling code. Which throughput configuration should you choose?
An e-commerce team needs to ingest 500,000 order documents nightly into a Cosmos DB container partitioned by /customerId. The documents span thousands of different customerId values, and each document is independent — partial failures are acceptable and should simply be retried. The team wants maximum ingestion throughput with the least code complexity. Which approach should they use?
A developer is writing a .NET application to migrate 50 million JSON documents into an Azure Cosmos DB for NoSQL container that has been provisioned with autoscale up to 40,000 RU/s. The migration runs from an Azure VM in the same region as the Cosmos DB account and must complete as quickly as possible while maximizing throughput utilization. Which combination of SDK configuration settings should the developer use?
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?
You maintain a Cosmos DB for NoSQL container named 'Orders' partitioned on '/customerId'. A reporting dashboard runs the query: SELECT * FROM c WHERE c.status = 'Shipped' AND c.region = 'EU'. Neither 'status' nor 'region' is the partition key, and the container spans 40 physical partitions. Users complain the query consumes excessive RUs. Which explanation and remediation is most accurate?
You design a Cosmos DB for NoSQL solution for an e-commerce site. Product documents are stored in a 'products' container, and customer reviews are stored in a separate 'reviews' container partitioned by /productId. The most common query on the reviews page displays each review along with the product's current display name. Product names are edited rarely (a few times per year), but review pages are read millions of times per day. Which data modeling approach minimizes RU cost for the high-volume read?
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?
You are designing a Cosmos DB data model for an e-commerce platform. Each order contains between 1 and 30 line items. Line items are always read together with the order, are never queried independently, and are never updated after the order is placed. Orders are read frequently and the entire order document averages 8 KB. Which data modeling approach best fits this access pattern?
A startup is building a proof-of-concept application and wants to minimize Azure Cosmos DB costs during initial development. The team decides to enable the free tier when creating a new Azure Cosmos DB for NoSQL account. Their expected steady-state workload needs about 800 RU/s of provisioned throughput and 20 GB of storage. Which statement correctly describes what the free tier provides and the impact on this workload?
You are developing a .NET application that uses the Azure Cosmos DB SDK to perform high-volume point reads and writes with the lowest possible latency. The application runs inside a corporate network where outbound traffic is restricted by a strict firewall that only permits HTTPS traffic on port 443. During load testing in this environment you notice that the SDK cannot establish connections when configured for the fastest connectivity mode. Which change should you make to allow the SDK to connect through the firewall while understanding the trade-off involved?
You maintain a Cosmos DB container for an e-commerce platform that stores orders, partitioned by /customerId. A reporting feature must return, for a single specified customer, the total amount spent per month. The query currently uses GROUP BY on month and executes across all partitions, consuming more RUs than expected. Which change will most effectively reduce the RU cost of this specific query?
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?
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?
An e-commerce container stores order documents where each order has a nested array named 'items', with each item containing a 'category' field. A developer needs a query that returns one row per order-item combination, filtered to only items where category = 'Electronics', so downstream reporting can list each electronics line individually. Which SQL query correctly accomplishes this in Azure Cosmos DB for NoSQL?
You are modeling a blogging platform in Azure Cosmos DB for NoSQL. Each Post can have many Tags, and each Tag applies to many Posts (a many-to-many relationship). Tag metadata (name, description, color) is edited rarely but read constantly. Users frequently query 'all posts for a given tag' and 'all tags on a given post'. Tag descriptions must stay reasonably current across the site. Which modeling approach best balances read performance and update maintainability?
You are designing a Cosmos DB container for a social media platform. Each user document embeds an array of posts. Product analytics show that active users can accumulate tens of thousands of posts over time, and the document grows continuously. Users frequently read their own profile but only occasionally query all their posts at once. What is the most appropriate data modeling decision?
A retail company runs an Azure Cosmos DB for NoSQL container configured with autoscale throughput at a maximum of 20,000 RU/s. During most of the day, actual utilization stays near 2,000 RU/s, but a nightly batch job briefly pushes usage to the configured maximum. The finance team asks the developer to explain how billing works for this autoscale configuration so they can forecast costs. Which statement correctly describes the hourly billing behavior?
An e-commerce application stores shopping cart documents in an Azure Cosmos DB for NoSQL container. Multiple client sessions can update the same cart concurrently. The development team must ensure that when two users update the same cart at nearly the same time, one update does not silently overwrite the other, without introducing pessimistic locking that would reduce throughput. Which approach should the team implement?
More DP-420 practice
Keep going with the other Microsoft Azure Cosmos DB Developer Specialty (DP-420) domains, or take a full timed mock exam.
← Back to DP-420 overview