DP-420 Sample Questions & Answers
Modeling non-relational data and its partitioning strategy, plus sizing and scaling, carries the most weight, well ahead of monitoring, backup and security, optimizing query performance, replication, and tying in analytical workloads.
Launch the full DP-420 simulator →Showing 10 of 20 free samples.
- Question 1Intermediate
Maintain an Azure Cosmos DB solution · Implement a DevOps process for an Azure Cosmos DB solution
A DevOps engineer is tasked with automating the deployment of an Azure Cosmos DB for NoSQL account using Azure Resource Manager (ARM) templates. The requirement is to configure the account with two regions: 'East US' as the primary write region and 'West US' as a read region. The deployment must also specify the automatic failover policy with 'West US' having a failover priority of 1. Which property within the
Microsoft.DocumentDB/databaseAccountsresource in the ARM template should be configured to define the regions and failover priorities?Show answer & explanation
Correct answer: C
The
properties.locationsproperty in an ARM template for a Cosmos DB account is an array of location objects. Each object specifies alocationNameand afailoverPriority. The region withfailoverPriority: 0is the primary write region, and subsequent regions are assigned priorities of 1, 2, and so on, for the automatic failover order. - Question 2Beginner
Design and implement data models · Implement data access by using Azure Cosmos DB for NoSQL SDKs
True or False: When using the Azure Cosmos DB for NoSQL SDK and performing a transactional batch operation, all operations within the batch must target documents that reside within the same logical partition.
Show answer & explanation
Correct answer: A
Transactional batch operations in Azure Cosmos DB for NoSQL are scoped to a single logical partition. This is because they are executed as a single transaction on the database engine replica set that hosts the logical partition. This constraint ensures ACID properties for the operations within the batch. If you attempt to include operations for documents in different logical partitions, the entire batch operation will fail.
- Question 3Intermediate
Maintain an Azure Cosmos DB solution · Monitor and troubleshoot an Azure Cosmos DB solution
You are monitoring an Azure Cosmos DB for NoSQL account using Azure Monitor. You notice that the 'Max RU/s Per Partition' metric shows one partition consistently at 10,000 RU/s, while other partitions are below 1,000 RU/s. The container is configured with autoscale throughput up to 40,000 RU/s. Despite having ample overall throughput, the application is experiencing throttling (HTTP 429 errors). What is this condition called and what is the primary solution?
graph TD subgraph "RU Consumption per Physical Partition" P1["Partition 1: 10,000 RU/s"] -->|Throttling| App{Application} P2["Partition 2: 800 RU/s"] --> App P3["Partition 3: 500 RU/s"] --> App P4["Partition 4: 950 RU/s"] --> App end style P1 fill:#f77,stroke:#333,stroke-width:2pxShow answer & explanation
Correct answer: B
This scenario describes a classic 'hot partition' problem. A single physical partition is receiving a disproportionate amount of requests, causing it to hit the maximum throughput limit for a single partition (10,000 RU/s), while the overall container throughput is underutilized. The fundamental solution is to change the partition key to one that distributes requests more evenly across all logical and physical partitions, such as using a synthetic key or a key with higher cardinality.
- Question 4Intermediate
Maintain an Azure Cosmos DB solution · Implement backup and restore for an Azure Cosmos DB solution
A developer needs to implement a point-in-time restore for a critical Azure Cosmos DB for NoSQL account. The requirement is to be able to restore the account to any state within the last 15 days with a granularity of one second. The account currently has periodic backup configured with a 4-hour interval and 2 copies retained. What is the first and most critical step the developer must take to meet the new requirement?
Show answer & explanation
Correct answer: B
The requirement for granular, second-level point-in-time restore (PITR) can only be met by continuous backup mode. Periodic backup creates discrete snapshots at set intervals (e.g., every 4 hours). Continuous backup, on the other hand, constantly records changes, allowing for restoration to any point in time within the retention period (up to 30 days). The first step is to migrate the account's backup policy, which can be done via the Azure Portal, CLI, or ARM templates.
- Question 5Intermediate
Maintain an Azure Cosmos DB solution · Implement security for an Azure Cosmos DB solution
You need to implement security for an Azure Cosmos DB for NoSQL account to ensure that developers on your team can only manage database and container settings (control plane operations) but cannot read or write data (data plane operations). The developers must be able to perform their tasks through the Azure portal. Which Azure role should you assign to the developers at the Cosmos DB account scope?
Show answer & explanation
Correct answer: A
The 'Cosmos DB Operator' role is specifically designed for this scenario. It grants permissions to manage Azure Cosmos DB resources (accounts, databases, containers) but does not grant access to the data itself or the ability to use the Data Explorer. This effectively separates control plane management from data plane access, adhering to the principle of least privilege.
- Question 6Advanced
Design and implement data models · Design a data partitioning strategy for Azure Cosmos DB for NoSQL
An IoT application writes telemetry data to an Azure Cosmos DB for NoSQL container. The data model includes a
deviceIdand atimestamp. To ensure even write distribution, a synthetic partition key is created by combiningdeviceIdand the current month and year (e.g.,DEVICE123-2024-08). The application frequently queries for all data for a specific device within a given date range. An example query isSELECT * FROM c WHERE c.deviceId = 'DEVICE123' AND c.timestamp >= '2024-08-15T00:00:00Z' AND c.timestamp <= '2024-08-15T23:59:59Z'. How will this query execute in terms of partitioning?Show answer & explanation
Correct answer: B
For a query to be a single-partition query, the
WHEREclause must include a filter that specifies the exact value of the partition key. In this case, the partition key isdeviceIdcombined with the month and year. The query only filters ondeviceIdandtimestamp. Since the full partition key value (e.g., 'DEVICE123-2024-08') cannot be derived from the query filters, Cosmos DB must execute it as a cross-partition query, scanning all partitions that could potentially contain data for 'DEVICE123'. - Question 7IntermediateSelect 3
Design and implement data models · Implement client connectivity options in the Azure Cosmos DB SDK
A developer is using the Azure Cosmos DB for NoSQL .NET SDK. To optimize performance and resource utilization, they are implementing the recommended singleton pattern for the
CosmosClientinstance. Which of the following are key reasons why using a singletonCosmosClientis a critical best practice? (Select THREE)Show answer & explanation
Correct answers: A, B, E
Creating a new
CosmosClientfor each request can lead to creating new TCP connections, which can exhaust the available sockets on the client machine, leading to connectivity errors.The
CosmosClientinstance performs initial metadata requests to get the routing table for partitions. Reusing the client allows this information to be cached, significantly reducing the latency of subsequent requests.The
CosmosClientis responsible for managing the underlying connections. A singleton pattern ensures this management is efficient and stable over the lifetime of the application, which is particularly important for the more complex connection pooling used in Direct mode. - Question 8Advanced
Maintain an Azure Cosmos DB solution · Implement data movement for an Azure Cosmos DB solution
You are migrating a large dataset from an on-premises SQL Server to an Azure Cosmos DB for NoSQL container. The migration must be completed as quickly as possible. The target container has been provisioned with 100,000 RU/s. You are using the .NET SDK's bulk support feature. After starting the migration, you observe that the write throughput is much lower than the provisioned 100,000 RU/s, and you are not receiving any throttling (429) responses. What is the most likely cause for the underutilization of provisioned throughput?
Show answer & explanation
Correct answer: A
The SDK's bulk support is highly dependent on the client's resources. It creates many concurrent tasks to saturate the provisioned throughput. If the client machine (e.g., a VM running the script) has limited CPU, memory, or network bandwidth, it can become the bottleneck, unable to generate requests fast enough to consume the available RUs on the server side. Since no throttling is occurring, the bottleneck is on the client side, not the server side.
- Question 9Beginner
Design and implement data models · Implement server-side programming in Azure Cosmos DB for NoSQL by using JavaScript
A developer is writing a JavaScript stored procedure for Azure Cosmos DB for NoSQL to create a new user document and a corresponding settings document within a single transaction. The stored procedure must ensure that either both documents are created or neither is. The partition key for the container is
/userId. Which function from the context object (__) should the developer use to create the user document inside the stored procedure?Show answer & explanation
Correct answer: C
Within a JavaScript stored procedure, the
createDocumentfunction is used to create a new document. It takes the collection's self-link, the document body, and an optional callback function as parameters. All operations performed within a single stored procedure execution are transactional, provided they target the same logical partition. - Question 10Intermediate
Integrate an Azure Cosmos DB solution · Enable Azure Cosmos DB analytical workloads
An architect is designing a solution that requires both a transactional store for a live application and an analytical store for business intelligence queries. They have enabled Azure Synapse Link on their Azure Cosmos DB for NoSQL container. A data scientist needs to query the analytical store using a serverless SQL pool in Azure Synapse Analytics. Which statement accurately describes the data synchronization process between the transactional and analytical stores?
sequenceDiagram participant App as Application participant TS as Transactional Store participant AS as Analytical Store participant Synapse as Synapse Serverless SQL App->>+TS: Write/Update/Delete Operation TS-->>-App: Acknowledge loop Auto-Sync Process TS->>AS: Propagate changes end Note right of AS: Latency typically < 2 minutes Synapse->>+AS: T-SQL Query AS-->>-Synapse: Return Analytical DataShow answer & explanation
Correct answer: C
Azure Synapse Link uses an auto-sync process that propagates data from the transactional store to the analytical store. This process is designed to have minimal impact on the transactional workload and does not consume any of the provisioned RUs. The typical latency for data to become available in the analytical store is about 2 minutes.
Ready for the real thing?
The full DP-420 simulator has every exam-style question, timed mode, and instant scoring.