Medium DP-420 practice questions
Applied — put a concept to work in a realistic situation. 84 medium questions available — no sign-up, always free.
A retail company runs an Azure Cosmos DB account with a single write region in East US. Their customer base has expanded significantly to Western Europe, and European users are reporting slow write latency when submitting orders, while reads remain acceptable. The team wants to reduce write latency for European customers with minimal application changes and without sacrificing the ability to resolve conflicting concurrent writes. Which configuration change should they make?
A retail company exposes its Azure Cosmos DB for NoSQL product catalog through an Azure AI Search index using an indexer. Products are frequently discontinued, and when they are, the corresponding document is physically deleted from the Cosmos DB container. Users complain that discontinued products still appear in search results even after the indexer runs on schedule. Which action should you take so the indexer removes deleted products from the search index?
A retail company stores product documents in an Azure Cosmos DB for NoSQL container. The product catalog team wants to add a semantic product search feature to their website that returns products based on meaning rather than exact keyword matches. They plan to use Azure AI Search over the Cosmos DB data. The team already generates text embeddings for each product description. Which Azure AI Search capability should they configure to satisfy this semantic-similarity requirement?
A healthcare application stores patient records in Azure Cosmos DB for NoSQL. Compliance requires that the 'nationalId' property be encrypted client-side so that plaintext is never visible to the database engine. Developers must still be able to run queries that filter documents using an exact-match equality predicate on 'nationalId'. When configuring Always Encrypted for this property, which encryption type must you select?
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?
A financial services company runs a single-write-region Cosmos DB account with the write region in East US and read regions in West US and North Europe. They have enabled service-managed (automatic) failover and configured failover priorities as: 0 = East US, 1 = North Europe, 2 = West US. During a regional outage that makes East US unavailable, what happens to the write region?
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?
A retail team stores a product catalog in an Azure Cosmos DB for NoSQL container. They want to expose full-text and faceted search over the catalog using Azure AI Search, and the index must automatically pick up new and modified products without re-crawling the entire container each run. Products are updated frequently throughout the day. What is the most appropriate way to configure the Azure AI Search indexer for this requirement?
An e-commerce platform stores individual order documents in a Cosmos DB container partitioned by /customerId. The analytics team needs a separate 'customerSummary' container that maintains a running total of each customer's lifetime spend and order count, updated within seconds of any new order. The solution must scale automatically and avoid expensive periodic full-container scans. Which approach best meets these requirements?
An e-commerce platform stores each customer's order in an 'orders' container partitioned by /customerId. The team needs an Azure Function triggered by the Cosmos DB change feed that, for every new or updated order, must (1) write a denormalized summary document to a 'customerOrderHistory' container and (2) push a message to a Service Bus queue for downstream fulfillment. The function must process changes reliably and scale across partitions automatically. Which approach correctly implements this integration?
Your team built an Azure Function with a Cosmos DB trigger to process the change feed of an 'Orders' container for real-time fraud scoring. During a marketing campaign, order volume increases tenfold. You observe that a single Function instance is processing all changes and cannot keep up, causing rising latency. The container has 20 physical partitions. What is the correct way to enable the Function to scale out and process changes in parallel across multiple instances?
You operate a production Azure Cosmos DB for NoSQL account with a single container using autoscale throughput. Users intermittently report HTTP 429 errors during peak hours. You want to be proactively notified the moment the underlying cause—a physical partition consistently approaching its throughput ceiling—begins to occur, before users experience widespread throttling. Which Azure Monitor metric should you build the alert rule on to detect this specific condition?
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 financial services company runs a globally distributed Cosmos DB account with a single write region in East US and read regions in West Europe and Southeast Asia. Compliance requires that reads never lag the write region by more than a defined number of write operations OR a defined time interval, whichever comes first, so auditors can bound the maximum data divergence. Which consistency level satisfies this requirement, and what must the team configure?
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 company stores order documents in an Azure Cosmos DB for NoSQL container. Compliance requires that once an order document reaches a 'Completed' status, a copy must be moved to Azure Blob Storage for long-term archival, and the archived record must never be lost even if processing fails temporarily. The team wants a serverless, low-maintenance approach that automatically reacts to changes. Which design best meets these requirements?
Your team runs an Azure Functions app with a Cosmos DB trigger that processes the change feed from an 'Orders' container. During a recent sales event, downstream systems reported that order-processing events were arriving several minutes late. You need to programmatically measure how far behind the change feed processor is falling so you can trigger alerts and scale the function before the backlog grows. Which approach should you implement?
An e-commerce platform stores Customers and Orders in separate Azure Cosmos DB for NoSQL containers. When a customer record is soft-deleted (a 'deleted' flag set to true), the business requires that all of that customer's orders be automatically marked as orphaned within seconds, without impacting the write latency of the customer-facing application. Which approach best satisfies this requirement?
An e-commerce team stores orders in a Cosmos DB container partitioned by /customerId. A separate reporting service needs a continuously updated materialized view aggregating daily sales totals per product into a second container partitioned by /productId. The team wants a low-latency, resilient mechanism that reacts to each new or updated order without polling or scheduled full scans. Which approach should they implement?
A logistics company stores shipment documents in a Cosmos DB for NoSQL container. A dashboard runs a frequent query that filters on `WHERE c.warehouseId = @id` and returns results ordered by two fields: `ORDER BY c.status ASC, c.createdDate DESC`. The query currently fails at runtime with an error stating that an ORDER BY query requires a corresponding composite index. Which change to the indexing policy will allow this query to execute?
A retail analytics team runs a frequent query against a Cosmos DB container that returns the newest, highest-value orders: SELECT * FROM c WHERE c.status = 'shipped' ORDER BY c.orderDate DESC, c.totalAmount DESC. The query currently fails at runtime with an error indicating the ORDER BY clause cannot be served. The container uses the default indexing policy. What is the most appropriate change to make this multi-property ORDER BY query succeed with minimal RU overhead?
A social media application writes a sequence of user actions to a single-region Cosmos DB account: a user posts a comment (write 1), then edits it (write 2), then deletes it (write 3). The team wants readers in the same region to never see these writes out of order (for example, seeing the delete before the edit), but they want the lowest possible read latency and RU cost that still guarantees ordered reads. They do NOT require reads to always return the most recent write. Which consistency level should they configure?
An e-commerce reporting service queries a Cosmos DB container with millions of order documents. The query returns thousands of matching results, but the frontend displays only 50 items per page. Currently the code executes the query, materializes the entire result set into memory, and slices out 50 items per request — consuming large amounts of RUs and memory on every page load. You must minimize RU cost and memory usage while preserving the ability to fetch subsequent pages. What should you do?
A security team wants operations engineers to be able to create and modify Azure Cosmos DB accounts, adjust throughput settings, and manage failover priorities through the Azure portal and ARM, but they must be prevented from reading or writing any document data inside containers. Which approach satisfies these requirements with the least privilege?
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?