Microsoft Designing and Implementing Cloud-Native Applications Using Microsoft Azure Cosmos DB - DP-420 Exam Practice Test
You are implementing an Azure Data Factory data flow that will use an Azure Cosmos DB for NoSQL sink to write a dataset. The data flow will use 2,000 Apache Spark partitions.
You need to ensure that the ingestion from each Spark partition is balanced to optimize throughput.
Which sink setting should you configure?
You need to ensure that the ingestion from each Spark partition is balanced to optimize throughput.
Which sink setting should you configure?
Correct Answer: C
Vote an answer
Explanation: Only visible for Fast2test members. You can sign-up / login (it's free).
You are designing an Azure Cosmos DB for NoSQL solution to store data from IoT devices.
Writes from the devices will be occur every second.
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?
Writes from the devices will be occur every second.
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?
Correct Answer: C
Vote an answer
Explanation: Only visible for Fast2test members. You can sign-up / login (it's free).
Range, spatial, and composite are three different types of indexes supported by Azure Cosmos DB.
Which of these indexes are used for geospatial objects like points, polygons, LineStrings, etc?
Which of these indexes are used for geospatial objects like points, polygons, LineStrings, etc?
Correct Answer: B
Vote an answer
Explanation: Only visible for Fast2test members. You can sign-up / login (it's free).
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?
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?
Correct Answer: C
Vote an answer
Explanation: Only visible for Fast2test members. You can sign-up / login (it's free).
You are creating an Azure Cosmos DB for NoSQL account.
You need to choose whether to configure capacity by using either provisioned throughput or serverless mode.
Which two workload characteristics cause you to choose serverless mode? Each correct answer presents part of the solution.
NOTE: Each correct selection is worth one point.
You need to choose whether to configure capacity by using either provisioned throughput or serverless mode.
Which two workload characteristics cause you to choose serverless mode? Each correct answer presents part of the solution.
NOTE: Each correct selection is worth one point.
Correct Answer: B,D
Vote an answer
You have an Azure subscription that contains an Azure Cosmos DB for NoSQL account named account1.
In account1, you create a container that has the following configurations:
- Partition key: CompanyID
- Composite unique key: UserName and EmailAddress
To the container, you plan to add the data items shown in the following table.

How many conflicts will occur?
In account1, you create a container that has the following configurations:
- Partition key: CompanyID
- Composite unique key: UserName and EmailAddress
To the container, you plan to add the data items shown in the following table.

How many conflicts will occur?
Correct Answer: A
Vote an answer
Explanation: Only visible for Fast2test members. You can sign-up / login (it's free).
Hotspot Question
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.

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.

Correct Answer:

Hotspot Question
You have the indexing policy shown in the following exhibit.
\

Use the drop-down menus to select the answer choice that answers each question based on the information presented in the graphic.
NOTE: Each correct selection is worth one point.

You have the indexing policy shown in the following exhibit.
\

Use the drop-down menus to select the answer choice that answers each question based on the information presented in the graphic.
NOTE: Each correct selection is worth one point.

Correct Answer:

Explanation:
Box 1: ORDER BY c.name DESC, c.age DESC
Queries that have an ORDER BY clause with two or more properties require a composite index.
The following considerations are used when using composite indexes for queries with an ORDER BY clause with two or more properties:
If the composite index paths do not match the sequence of the properties in the ORDER BY clause, then the composite index can't support the query.
The order of composite index paths (ascending or descending) should also match the order in the ORDER BY clause.
The composite index also supports an ORDER BY clause with the opposite order on all paths.
Box 2: At the same time as the item creation
Azure Cosmos DB supports two indexing modes:
Consistent: The index is updated synchronously as you create, update or delete items. This means that the consistency of your read queries will be the consistency configured for the account.
None: Indexing is disabled on the container.
Reference: https://docs.microsoft.com/en-us/azure/cosmos-db/index-policy
You have an Azure Cosmos DB for NoSQL account named account1 that supports an application named App1. App1 uses the consistent prefix consistency level.
You configure account1 to use a dedicated gateway and integrated cache.
You need to ensure that App1 can use the integrated cache.
Which two actions should you perform for App1? Each correct answer presents part of the solution.
NOTE: Each correct selection is worth one point.
You configure account1 to use a dedicated gateway and integrated cache.
You need to ensure that App1 can use the integrated cache.
Which two actions should you perform for App1? Each correct answer presents part of the solution.
NOTE: Each correct selection is worth one point.
Correct Answer: B,C
Vote an answer
Explanation: Only visible for Fast2test members. You can sign-up / login (it's free).
Hotspot Question
You have a database in an Azure Cosmos DB Core (SQL) API account.
You plan to create a container that will store employee data for 5,000 small businesses. Each business will have up to 25 employees. Each employee item will have an emailAddress value.
You need to ensure that the emailAddress value for each employee within the same company is unique.
To what should you set the partition key and the unique key? To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.

You have a database in an Azure Cosmos DB Core (SQL) API account.
You plan to create a container that will store employee data for 5,000 small businesses. Each business will have up to 25 employees. Each employee item will have an emailAddress value.
You need to ensure that the emailAddress value for each employee within the same company is unique.
To what should you set the partition key and the unique key? To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.

Correct Answer:

Explanation:
Box 1: CompanyID
After you create a container with a unique key policy, the creation of a new or an update of an existing item resulting in a duplicate within a logical partition is prevented, as specified by the unique key constraint. The partition key combined with the unique key guarantees the uniqueness of an item within the scope of the container.
For example, consider an Azure Cosmos container with Email address as the unique key constraint and CompanyID as the partition key. When you configure the user's email address with a unique key, each item has a unique email address within a given CompanyID. Two items can't be created with duplicate email addresses and with the same partition key value.
Box 2: emailAddress
UniqueKey will need to be set to emailAddress, since the job of a unique key is to ensure uniqueness of a value within a logical partition.
Reference: https://docs.microsoft.com/en-us/azure/cosmos-db/unique-keys
You need to configure an Apache Kafka instance to ingest data from an Azure Cosmos DB for NoSQL account. The data from a container named telemetry must be added to a Kafka topic named iot.
The solution must store the data in a compact binary format.
Which three configuration items should you include in the solution? Each correct answer presents part of the solution.
NOTE: Each correct selection is worth one point.
The solution must store the data in a compact binary format.
Which three configuration items should you include in the solution? Each correct answer presents part of the solution.
NOTE: Each correct selection is worth one point.
Correct Answer: D,E,F
Vote an answer
Explanation: Only visible for Fast2test members. You can sign-up / login (it's free).
Hotspot Question
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.

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.

Correct Answer:
