Microsoft

DP-420 Free Practice Questions — Page 2

Question 6

You have an app named App1 that uses an Azure Cosmos DB for NoSQL database. App1 uses the spatial columns shown in the following table. You need to design an indexing strategy for App1. Which columns can be indexed by using spatial indexes?

Illustration for DP-420 question 6
A. Col1 only
B. Col1 and Col2 only
C. Col1, Col2, and Col3 only
D. Col1, Col2, and Col4 only
Show Answer
Correct Answer: D
Explanation:
Azure Cosmos DB spatial indexes support GeoJSON types such as Point, LineString, and MultiPolygon. Curve and MultiCurve are not supported spatial types, so Col3 and Col5 cannot be indexed this way. Therefore, the indexable columns among those listed are Col1, Col2, and Col4.

Question 6

You have an Azure Cosmos DB for NoSQL account that contains a database named DB1. Users run the following query against DB1. SELECT * FROM c WHERE c.bikeParts = "Frame, Chain, Peddles" ORDER BY c.bikeParts ASC You add an index to the recordset. You need to change the ORDER BY syntax of the query to optimize the use of the index. The solution must NOT change the result set. Which syntax should you use?

A. ORDER BY c._ts ASC, c.bikeParts DESC
B. ORDER BY c._ts DESC, c.bikeParts ASC
C. ORDER BY c.bikeParts ASC, c._ts ASC
D. ORDER BY c.bikeParts DESC, c._ts ASC
Show Answer
Correct Answer: C
Explanation:
Use `ORDER BY c.bikeParts ASC, c._ts ASC`. This preserves the original ascending order on `bikeParts` and adds `_ts` as a secondary sort key, allowing a matching composite index to support the ordering. Since the filter fixes `bikeParts` to one value, the added key only orders documents within that matching group.

Question 7

You have an Azure subscription that contains the resources shown in the following table. You need to store the account key of account1 in KV1. What should you use?

Illustration for DP-420 question 7
A. a key
B. a secret
C. a certificate
Show Answer
Correct Answer: B
Explanation:
Store the Cosmos DB account key as a secret in Azure Key Vault. Secrets are intended for sensitive values such as passwords, connection strings, and account keys; Key Vault keys are for cryptographic operations.

Question 9

HOTSPOT You have an Azure Cosmos DB for NoSQL account that contains a container named Container1. You add a composite index to the default indexing policy of Container1. The index has the following definition. firstName ASC, age ASC You plan to execute the following query against Container1. SELECT * FROM C WHERE c.firstName = "John" AND c.age > 21 AND c._ts < 1612213196 You need to optimize the performance of the query by adding an additional index. How should you complete the additional index? To answer, select the appropriate options in the answer area. NOTE: Each correct selection is worth one point.

Illustration for DP-420 question 9
Show Answer
Correct Answer: First component: firstName ASC Second component: _ts DESC
Explanation:
The existing index covers the firstName equality filter and the age range filter. Adding an index that starts with firstName and then includes _ts supports the equality filter and the timestamp range filter.

Question 9

You are designing an Azure Cosmos DB for NoSQL solution to store data from IoT devices. Writes from the devices will occur every second. Data will be retained indefinitely. The following is a sample of the data. You need to select a partition key that meets the following requirements for writes: • Minimizes the partition skew • Avoids capacity limits • Avoids hot partitions What should you do?

Illustration for DP-420 question 9
A. Use deviceManufacturer as the partition key.
B. Create a new synthetic key that contains deviceId and timestamp.
C. Create a new synthetic key that contains deviceId and deviceManufacturer.
D. Use deviceId as the partition key.
Show Answer
Correct Answer: B
Explanation:
Use a synthetic key containing deviceId and timestamp. Because each device writes every second, the timestamp creates many distinct partition-key values, distributing writes and avoiding a single device’s logical partition becoming hot or growing without bound. Manufacturer alone has low cardinality and can skew writes; deviceId, with or without manufacturer, can concentrate writes and retained data for each device.

Question 10

HOTSPOT You have an Azure subscription that contains an Azure Cosmos DB for NoSQL account. The account hosts a container named Container1. Items are stored in Container1 in the following format. You need to query name, sizeInGb, and currentStockLevel for items that have a value of currentStockLevel that is greater than 100. How should you complete the query? To answer, select the appropriate options in the answer area. NOTE: Each correct selection is worth one point.

Illustration for DP-420 question 10 Illustration for DP-420 question 10
Show Answer
Correct Answer: First blank: JOIN Second blank: IN
Explanation:
JOIN ao IN d.availableOptions expands the array into individual options. The WHERE clause then keeps only options whose currentStockLevel exceeds 100.

Question 12

You have an Azure Cosmos DB database named database1 that contains a container named container1. The container1 container stores product data and has the following indexing policy. Which path will be indexed?

Illustration for DP-420 question 12
A. /product/category
B. /product/brand/tailspin
C. /product/brand
D. /product/[]/category
Show Answer
Correct Answer: A
Explanation:
The included path `/product/category/?` indexes the category property itself. The `?` does not include nested properties such as `/product/brand/tailspin`. Sources: https://learn.microsoft.com/en-us/azure/cosmos-db/indexing-policies

Question 13

You plan to create an Azure Cosmos DB account that will use an integrated cache. What will prevent you from using an integrated cache?

A. a user-assigned managed identity
B. Azure Private Link
C. a default consistency level of Session
D. availability zones
Show Answer
Correct Answer: D
Explanation:
Integrated cache uses the dedicated gateway. Dedicated gateway provisioning for accounts configured with availability zones is supported only in East US and North Europe, so availability zones can prevent its use in other regions. Private Link can be configured with a separate endpoint for the dedicated gateway, and Session consistency is compatible.

Question 14

You have an Azure subscription. The subscription contains an Azure Cosmos DB for NoSQL account named account1 that hosts a container named Container1. Container1 has a provisioned throughput of 100 request units per second (RU/s) and uses a single physical partition. You are evaluating the available throughput for Container1. What is the maximum burst capacity that Container1 can accumulate?

A. 300 RU/s
B. 1,000 RU/s
C. 30,000 RU/s
D. 100,000 RU/s
Show Answer
Correct Answer: C
Explanation:
Burst capacity can accumulate up to 300 seconds of unused throughput. With 100 RU/s on the single physical partition, the maximum is 100 × 300 = 30,000 RU.

Question 15

You have an Azure subscription. The subscription contains an Azure Cosmos DB for NoSQL account named account1 that hosts a container named Devices. Devices has a partition key named type. You plan to execute the following query. SELECT d.deviceName FROM d WHERE d.deviceId = 'ABC102' AND d.type = 'car' AND d.importanceId = 4 You are evaluating the resource utilization of the query. How will the query be executed?

A. as an in-partition query
B. as a parallel cross-partition query
C. as a cross-partition query
Show Answer
Correct Answer: A
Explanation:
The query filters on `type`, which is the container’s partition key, with an equality condition. Cosmos DB can route it to the single partition for `type = 'car'`, so it executes as an in-partition query. The other filters do not require a cross-partition scan.

$19

Get all 134 questions with detailed answers and explanations

  • Instant download HTML + PDF delivered the moment payment clears.
  • Secure Stripe checkout we never see or store your card details.
  • 7-day refund if files are defective see our refund policy.