Microsoft

DP-420 Free Practice Questions — Page 4

Question 31

HOTSPOT You have an Azure subscription that contains an Azure Cosmos DB for NoSQL account. You define and implement an encryption policy by using the following C# code: For each of the following statements, select Yes if the statement is true, otherwise select No. NOTE: Each correct selection is worth one point.

Illustration for DP-420 question 31 Illustration for DP-420 question 31
Show Answer
Correct Answer: 1. Yes 2. No 3. No
Explanation:
Deterministic encryption of taxId supports equality queries. Randomized encryption of creditCard can produce different ciphertext for the same value. Creating the container does not update the encryption policy of an existing container.

Question 32

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?

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 Point, LineString, Polygon, and MultiPolygon geometries. Therefore, Col1, Col2, and Col4 can be indexed; Col3 cannot.

Question 33

You plan to implement an Azure Cosmos DB container that will store telemetry data from 1,000 IoT devices. The data will be updated once every minute. An app will read the data once daily and generate aggregated reports that summarize the state of each device. You need to configure a partition key for the container. The solution must meet the following requirements: • Minimize the possibility of reaching the partition limits. • Spread read and write operations evenly across the partitions. • Minimize how long it takes to locate a specific set of telemetry values. To what should you set the partition key?

A. the device ID and date
B. the device ID
C. the date and a random value
D. the date
Show Answer
Correct Answer: A
Explanation:
Use the device ID and date as a composite partition key. This distributes telemetry across device-and-date partitions, reducing the chance that any one logical partition reaches its storage or throughput limits. It also supports targeted queries for a device’s telemetry on a particular date, while avoiding the hot partitions that a date-only key could create.

Question 34

You have an Azure Cosmos DB for NoSQL container named Container1 that contains 20,000 items. The items have 1,000 unique partition key values. Each item is 50 KB. You need to evaluate the cost of running cross-partition queries by using Container1. What should you do first?

A. Recreate Container1 by using a partition key that has higher cardinality.
B. Increase the number of items in Container1.
C. Recreate Container1 by using a partition key that has lower cardinality.
D. Decrease the number of items in Container1.
Show Answer
Correct Answer: B
Explanation:
Container1 holds about 1 GB of data (20,000 × 50 KB). Cross-partition query cost depends on the number of physical partitions queried, not simply the number of unique partition key values. Increase the number of items first so the container grows enough to span multiple physical partitions. Sources: https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/how-to-query-container#cross-partition-query https://learn.microsoft.com/azure/cosmos-db/partitioning

Question 35

HOTSPOT You have an Azure Cosmos DB for NoSQL account that hosts a container named Container1. Container1 stores items in the following format. You need to modify the contents of Container1 to conform to the following format. How should you complete the JSON Patch document? To answer, select the appropriate options in the answer area. NOTE: Each correct selection is worth one point.

Illustration for DP-420 question 35 Illustration for DP-420 question 35 Illustration for DP-420 question 35
Show Answer
Correct Answer: "op": "move" "from": "/color"
Explanation:
The move operation relocates the existing color property from the root to /inventory/color.

Question 36

You have an Azure subscription. You plan to create an Azure Cosmos DB for NoSQL database named DB1 that will store author and book data for authors that have each published up to ten books. Typical and frequent queries of the data will include: • All books written by an individual author • The synopsis of individual books You need to recommend a data model for DB1. The solution must meet the following requirements: • Support transactional updates of the author and book data. • Minimize read operation costs. What should you recommend?

A. Create a single container that stores author items and book items, and then items that represent the relationship between the authors and their books.
B. Create three containers, one that stores author items, a second that stores book items, and a third that stores items that represent the relationship between the authors and their books.
C. Create two containers, one that stores author items and another that stores book items. Embed a list of each author’s books in the corresponding author item.
D. Create a single container that stores author items and book items. Embed a list of each author’s books in the corresponding author item.
Show Answer
Correct Answer: D
Explanation:
Store the author and book items in one container, using the author ID as the partition key so related items can be updated in a transactional batch. Embedding each author’s books in the author item makes the frequent “all books by author” query a single-item read; separate book items allow an individual synopsis to be read directly.

Question 37

You have an Azure subscription that contains an Azure Cosmos DB for NoSQL database named DB1. In DB1, you plan to create a container that will use a hierarchical partition key. You need to identify which hierarchical partition key path to use when adding new items to the container. Which SDK class should you use?

A. CompositePath
B. PartitionKeyDefinition
C. PartitionKey
D. PartitionKeyBuilder
Show Answer
Correct Answer: D
Explanation:
Use `PartitionKeyBuilder` to build the hierarchical partition key value when adding an item. `PartitionKeyDefinition` describes the partition-key paths in the container definition; it is not used to construct an item’s partition key.

Question 38

HOTSPOT You have an Azure subscription. The subscription contains an Azure Cosmos DB for NoSQL account named account1 that hosts a container named Customers. Multi-region writes are allowed. You execute the following C# code. For each of the following statements, select Yes if the statement is true. Otherwise, select No. NOTE: Each correct selection is worth one point.

Illustration for DP-420 question 38 Illustration for DP-420 question 38
Show Answer
Correct Answer: Yes No Yes
Explanation:
The resolution path names the stored procedure whose ID is `conflict`. Custom conflict resolution does not put the last writer’s session token in an item’s `id`. Changing the container’s conflict resolution policy to LastWriterWins requires recreating the container.

Question 39

You have an Azure Cosmos DB for NoSQL container. All queries to the container use the Bounded Staleness consistency level. You discover that when many queries are executed against the container, an HTTP 429 error is returned. What are two ways to reduce the number of HTTP 429 errors? Each correct answer presents a complete solution. NOTE: Each correct selection is worth one point.

A. Use a query request option to change the consistency level to Strong.
B. Add a post-trigger to the container.
C. Add a pre-trigger to the container.
D. Add query retry logic to the client application.
E. Increase the maximum throughput.
Show Answer
Correct Answer: D, E
Explanation:
HTTP 429 indicates that requests are being rate-limited because the container’s available throughput is insufficient. Increasing the maximum throughput gives the container more capacity, and client-side retry logic lets throttled queries retry after the server’s suggested delay. Changing consistency to Strong or adding triggers does not address the throughput limit.

Question 40

HOTSPOT You have an Azure Cosmos DB for NoSQL account named Account1 that uses provisioned throughput capacity mode. Account1 contains the databases shown in the following table. The databases contain the containers shown in the following table. For each of the following statements, select Yes if the statement is true. Otherwise, select No. NOTE: Each correct selection is worth one point.

Illustration for DP-420 question 40 Illustration for DP-420 question 40 Illustration for DP-420 question 40
Show Answer
Correct Answer: No No Yes
Explanation:
db1’s autoscale billing minimum is below 4,000 RU/s. cn11 shares db2’s throughput, so it is not capped at 400 RU/s. db2 can have another container that uses its shared throughput.

$19

Get all 177 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.