Microsoft DP-420 Exam Practice Questions (P. 4)
- Full Access (150 questions)
- Six months of Premium Access
- Access to one million comments
- Seamless ChatGPT Integration
- Ability to download PDF files
- Anki Flashcard files for revision
- No Captcha & No AdSense
- Advanced Exam Configuration
Question #16
You have a database named db1 in an Azure Cosmos DB Core (SQL) API account.
You are designing an application that will use db1.
In db1, you are creating a new container named coll1 that will store online orders.
The following is a sample of a document that will be stored in coll1.

The application will have the following characteristics:
✑ New orders will be created frequently by different customers.
✑ Customers will often view their past order history.
You need to select the partition key value for coll1 to support the application. The solution must minimize costs.
To what should you set the partition key?
You are designing an application that will use db1.
In db1, you are creating a new container named coll1 that will store online orders.
The following is a sample of a document that will be stored in coll1.

The application will have the following characteristics:
✑ New orders will be created frequently by different customers.
✑ Customers will often view their past order history.
You need to select the partition key value for coll1 to support the application. The solution must minimize costs.
To what should you set the partition key?
- AorderId
- BcustomerIdMost Voted
- CorderDate
- Did
Correct Answer:
B
If most of your workload's requests are queries and most of your queries have an equality filter on the same property, this property can be a good partition key choice. For example, if you frequently run a query that filters on UserID, then selecting UserID as the partition key would reduce the number of cross-partition queries.
Reference:
https://docs.microsoft.com/en-us/azure/cosmos-db/partitioning-overview
B
If most of your workload's requests are queries and most of your queries have an equality filter on the same property, this property can be a good partition key choice. For example, if you frequently run a query that filters on UserID, then selecting UserID as the partition key would reduce the number of cross-partition queries.
Reference:
https://docs.microsoft.com/en-us/azure/cosmos-db/partitioning-overview
send
light_mode
delete
Question #17
You have a container in an Azure Cosmos DB Core (SQL) API account that stores data about orders.
The following is a sample of an order document.

Documents are up to 2 KB.
You plan to receive one million orders daily.
Customers will frequently view their past order history.
You are the evaluating whether to use orderDate as the partition key.
What are two effects of using orderDate as the partition key? Each correct answer presents a complete solution.
NOTE: Each correct selection is worth one point.
The following is a sample of an order document.

Documents are up to 2 KB.
You plan to receive one million orders daily.
Customers will frequently view their past order history.
You are the evaluating whether to use orderDate as the partition key.
What are two effects of using orderDate as the partition key? Each correct answer presents a complete solution.
NOTE: Each correct selection is worth one point.
- AYou will exceed the maximum number of partition key values
- BYou will exceed the maximum storage per partition
- CThere will always be a hot partitionMost Voted
- DQueries will run cross-partitionMost Voted
Correct Answer:
CD
Not C: But the problem is that ג€" when the application writes new data, the writes will always be directed to the same partition, based on whatever day it is. This results in what's called a hot partition, where we have a bottleneck that's going to quickly consume a great deal more of the reserved throughput you've provisioned for the container. Specifically, Cosmos DB evenly distributes your provisioned throughput across all the physical partitions in the container.
D: Customers will frequently view their past order history. OrderID will be used. Queries will run cross-partition
Incorrect:
Not B: 1 million a day x 2KB -> 2 GB of data/day while maximum storage across all items per (logical) partition: 20 GB
Reference:
https://www.tallan.com/blog/2019/04/30/horizontal-partitioning-in-azure-cosmos-db https://docs.microsoft.com/en-us/azure/cosmos-db/concepts-limits
CD
Not C: But the problem is that ג€" when the application writes new data, the writes will always be directed to the same partition, based on whatever day it is. This results in what's called a hot partition, where we have a bottleneck that's going to quickly consume a great deal more of the reserved throughput you've provisioned for the container. Specifically, Cosmos DB evenly distributes your provisioned throughput across all the physical partitions in the container.
D: Customers will frequently view their past order history. OrderID will be used. Queries will run cross-partition
Incorrect:
Not B: 1 million a day x 2KB -> 2 GB of data/day while maximum storage across all items per (logical) partition: 20 GB
Reference:
https://www.tallan.com/blog/2019/04/30/horizontal-partitioning-in-azure-cosmos-db https://docs.microsoft.com/en-us/azure/cosmos-db/concepts-limits
send
light_mode
delete
Question #18
You have a container in an Azure Cosmos DB Core (SQL) API account. The container stores data about families. Data about parents, children, and pets are stored as separate documents.
Each document contains the address of each family. Members of the same family share the same partition key named familyId.
You need to update the address for each member of the same family that share the same address. The solution must meet the following requirements:
✑ Be atomic, consistent, isolated, and durable (ACID).
✑ Provide the lowest latency.
What should you do?
Each document contains the address of each family. Members of the same family share the same partition key named familyId.
You need to update the address for each member of the same family that share the same address. The solution must meet the following requirements:
✑ Be atomic, consistent, isolated, and durable (ACID).
✑ Provide the lowest latency.
What should you do?
- AUpdate the document of each family member separately by using a patch operation
- BUpdate the document of each family member separately and set the consistency level to strong
- CUpdate the document of each family member by using a transactional batch operationMost Voted
Correct Answer:
C
Each transaction provides ACID (Atomicity, Consistency, Isolation, Durability) property guarantees.
Transactional batch operations offer reduced latency on equivalent operations.
Note: Transactional batch describes a group of point operations that need to either succeed or fail together with the same partition key in a container. In the .NET
SDK, the TransactionalBatch class is used to define this batch of operations. If all operations succeed in the order they are described within the transactional batch operation, the transaction will be committed. However, if any operation fails, the entire transaction is rolled back.
Reference:
https://docs.microsoft.com/en-us/azure/cosmos-db/sql/transactional-batch
C
Each transaction provides ACID (Atomicity, Consistency, Isolation, Durability) property guarantees.
Transactional batch operations offer reduced latency on equivalent operations.
Note: Transactional batch describes a group of point operations that need to either succeed or fail together with the same partition key in a container. In the .NET
SDK, the TransactionalBatch class is used to define this batch of operations. If all operations succeed in the order they are described within the transactional batch operation, the transaction will be committed. However, if any operation fails, the entire transaction is rolled back.
Reference:
https://docs.microsoft.com/en-us/azure/cosmos-db/sql/transactional-batch
send
light_mode
delete
Question #19
You are designing an Azure Cosmos DB Core (SQL) API 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?
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?
- ACreate a new synthetic key that contains deviceId and timestampMost Voted
- BUse timestamp as the partition key
- CUse deviceManufacturer as the partition key
- DUse sensor1Value as the partition key
Correct Answer:
A
Concatenate multiple properties of an item.
You can form a partition key by concatenating multiple property values into a single artificial partitionKey property. These keys are referred to as synthetic keys.
For example, consider the following example document:
{
"deviceId": "abc-123",
"date": 2018
}
For the previous document, one option is to set /deviceId or /date as the partition key. Use this option, if you want to partition your container based on either device
ID or date. Another option is to concatenate these two values into a synthetic partitionKey property that's used as the partition key.
{
"deviceId": "abc-123",
"date": 2018,
"partitionKey": "abc-123-2018"
}
Incorrect:
Not B: But the problem is that ג€" when the application writes new data, the writes will always be directed to the same partition, based on whatever day it is. This results in what's called a hot partition, where we have a bottleneck that's going to quickly consume a great deal more of the reserved throughput you've provisioned for the container. Specifically, Cosmos DB evenly distributes your provisioned throughput across all the physical partitions in the container.
Reference:
https://docs.microsoft.com/en-us/azure/cosmos-db/sql/synthetic-partition-keys https://docs.microsoft.com/en-us/azure/cosmos-db/concepts-limits
A
Concatenate multiple properties of an item.
You can form a partition key by concatenating multiple property values into a single artificial partitionKey property. These keys are referred to as synthetic keys.
For example, consider the following example document:
{
"deviceId": "abc-123",
"date": 2018
}
For the previous document, one option is to set /deviceId or /date as the partition key. Use this option, if you want to partition your container based on either device
ID or date. Another option is to concatenate these two values into a synthetic partitionKey property that's used as the partition key.
{
"deviceId": "abc-123",
"date": 2018,
"partitionKey": "abc-123-2018"
}
Incorrect:
Not B: But the problem is that ג€" when the application writes new data, the writes will always be directed to the same partition, based on whatever day it is. This results in what's called a hot partition, where we have a bottleneck that's going to quickly consume a great deal more of the reserved throughput you've provisioned for the container. Specifically, Cosmos DB evenly distributes your provisioned throughput across all the physical partitions in the container.
Reference:
https://docs.microsoft.com/en-us/azure/cosmos-db/sql/synthetic-partition-keys https://docs.microsoft.com/en-us/azure/cosmos-db/concepts-limits
send
light_mode
delete
Question #20
You need to create a data store for a directory of small and medium-sized businesses (SMBs). The data store must meet the following requirements:
✑ Store companies and the users employed by them. Each company will have less than 1,000 users.
✑ Some users have data that is greater than 2 KB.
✑ Associate each user to only one company.
✑ Provide the ability to browse by company.
✑ Provide the ability to browse the users by company.
✑ Whenever a company or user profile is selected, show a details page for the company and all the related users.
✑ Be optimized for reading data.
Which design should you implement to optimize the data store for reading data?
✑ Store companies and the users employed by them. Each company will have less than 1,000 users.
✑ Some users have data that is greater than 2 KB.
✑ Associate each user to only one company.
✑ Provide the ability to browse by company.
✑ Provide the ability to browse the users by company.
✑ Whenever a company or user profile is selected, show a details page for the company and all the related users.
✑ Be optimized for reading data.
Which design should you implement to optimize the data store for reading data?
- AIn a directory container, create a document for each company and a document for each user. Use the company ID as the partition key.
- BCreate a user container that uses the user ID as the partition key and a company container that uses the company ID as the partition key. Add the company ID to each user document.
- CIn a user container, create a document for each user. Embed the company into each user document. Use the user ID as the partition key.
- DIn a company container, create a document for each company. Embed the users into company documents. Use the company ID as the partition key.Most Voted
Correct Answer:
D
All employees within a company would nicely fit within a single document (document size 2 MB).
Note: An Azure Cosmos container is the unit of scalability both for provisioned throughput and storage. A container is horizontally partitioned and then replicated across multiple regions. The items that you add to the container are automatically grouped into logical partitions, which are distributed across physical partitions, based on the partition key.
Reference:
https://docs.microsoft.com/en-us/azure/cosmos-db/set-throughput
D
All employees within a company would nicely fit within a single document (document size 2 MB).
Note: An Azure Cosmos container is the unit of scalability both for provisioned throughput and storage. A container is horizontally partitioned and then replicated across multiple regions. The items that you add to the container are automatically grouped into logical partitions, which are distributed across physical partitions, based on the partition key.
Reference:
https://docs.microsoft.com/en-us/azure/cosmos-db/set-throughput
send
light_mode
delete
All Pages