
Microsoft Designing and Implementing Cloud-Native Applications Using Microsoft Azure Cosmos DB - DP-420 Exam Questions
QUESTION NO: 1
Case Study 1 - Litware, inc
Overview
Litware, Inc. is a United States-based grocery retailer. Litware has a main office and a primary datacenter in Seattle. The company has 50 retail stores across the United States and an emerging online presence. Each store connects directly to the internet. Existing environment.
Cloud and Data Service Environments. Litware has an Azure subscription that contains the resources shown in the following table.

Each container in productdb is configured for manual throughput. The con-product container stores the company's product catalog data. Each document in con-product includes a con- productvendor value. Most queries targeting the data in con-product are in the following format.
SELECT * FROM con-product p WHERE p.con-productVendor - 'name'
Most queries targeting the data in the con-productVendor container are in the following format SELECT * FROM con-productVendor pv ORDER BY pv.creditRating, pv.yearFounded Existing environment.
Current Problems.
Litware identifies the following issues:
- Updates to product categories in the con-productVendor container do not propagate automatically to documents in the con-product container.
- Application updates in con-product frequently cause HTTP status code 429 "Too many requests".
- You discover that the 429 status code relates to excessive request unit (RU) consumption during the updates.
Requirements.
Planned Changes
Litware plans to implement a new Azure Cosmos DB for NoSQL account named account2 that will contain a database named iotdb. The iotdb database will contain two containers named con- iot1 and con-iot2.
Litware plans to make the following changes:
- Store the telemetry data in account2.
- Configure account1 to support multiple read-write regions.
- Implement referential integrity for the con-product container.
- Use Azure Functions to send notifications about product updates to different recipients.
- Develop an app named App1 that will run from all locations and query the data in account1.
- Develop an app named App2 that will run from the retail stores and query the data in account2.
- App2 must be limited to a single DNS endpoint when accessing account2.
Requirements.
Business Requirements
Litware identifies the following business requirements:
- Whenever there are multiple solutions for a requirement, select the solution that provides the best performance, as long as there are no additional costs associated.
- Ensure that Azure Cosmos DB costs for IoT-related processing are predictable.
- Minimize the number of firewall changes in the retail stores.
Requirements.
Product Catalog Requirements
Litware identifies the following requirements for the product catalog:
- Implement a custom conflict resolution policy for the product catalog data.
- Minimize the frequency of errors during updates of the con-product container.
- Once multi-region writes are configured, maximize the performance of App1 queries against the data in account1.
- Trigger the execution of two Azure functions following every update to any document in the con- product container.
You are troubleshooting the current issues caused by the application updates.
Which action can address the application updates issue without affecting the functionality of the application?
Case Study 1 - Litware, inc
Overview
Litware, Inc. is a United States-based grocery retailer. Litware has a main office and a primary datacenter in Seattle. The company has 50 retail stores across the United States and an emerging online presence. Each store connects directly to the internet. Existing environment.
Cloud and Data Service Environments. Litware has an Azure subscription that contains the resources shown in the following table.

Each container in productdb is configured for manual throughput. The con-product container stores the company's product catalog data. Each document in con-product includes a con- productvendor value. Most queries targeting the data in con-product are in the following format.
SELECT * FROM con-product p WHERE p.con-productVendor - 'name'
Most queries targeting the data in the con-productVendor container are in the following format SELECT * FROM con-productVendor pv ORDER BY pv.creditRating, pv.yearFounded Existing environment.
Current Problems.
Litware identifies the following issues:
- Updates to product categories in the con-productVendor container do not propagate automatically to documents in the con-product container.
- Application updates in con-product frequently cause HTTP status code 429 "Too many requests".
- You discover that the 429 status code relates to excessive request unit (RU) consumption during the updates.
Requirements.
Planned Changes
Litware plans to implement a new Azure Cosmos DB for NoSQL account named account2 that will contain a database named iotdb. The iotdb database will contain two containers named con- iot1 and con-iot2.
Litware plans to make the following changes:
- Store the telemetry data in account2.
- Configure account1 to support multiple read-write regions.
- Implement referential integrity for the con-product container.
- Use Azure Functions to send notifications about product updates to different recipients.
- Develop an app named App1 that will run from all locations and query the data in account1.
- Develop an app named App2 that will run from the retail stores and query the data in account2.
- App2 must be limited to a single DNS endpoint when accessing account2.
Requirements.
Business Requirements
Litware identifies the following business requirements:
- Whenever there are multiple solutions for a requirement, select the solution that provides the best performance, as long as there are no additional costs associated.
- Ensure that Azure Cosmos DB costs for IoT-related processing are predictable.
- Minimize the number of firewall changes in the retail stores.
Requirements.
Product Catalog Requirements
Litware identifies the following requirements for the product catalog:
- Implement a custom conflict resolution policy for the product catalog data.
- Minimize the frequency of errors during updates of the con-product container.
- Once multi-region writes are configured, maximize the performance of App1 queries against the data in account1.
- Trigger the execution of two Azure functions following every update to any document in the con- product container.
You are troubleshooting the current issues caused by the application updates.
Which action can address the application updates issue without affecting the functionality of the application?
Correct Answer: B
Explanation: Only visible for Pass4Test members. You can sign-up / login (it's free).
QUESTION NO: 2
Hotspot Question
You have a multi-region Azure Cosmos DB account named account1 that has a default consistency level of strong.
You have an app named App1 that is configured to request a consistency level of session.
How will the read and write operations of App1 be handled? To answer, select the appropriate options in the answer area.

Hotspot Question
You have a multi-region Azure Cosmos DB account named account1 that has a default consistency level of strong.
You have an app named App1 that is configured to request a consistency level of session.
How will the read and write operations of App1 be handled? To answer, select the appropriate options in the answer area.

Correct Answer:

Explanation:
An account configured for strong consistency by default will still write and replicate data synchronously to every region in the account. When the SDK client instance or request overrides this with Session or weaker consistency, reads will be performed using a single replica.
https://learn.microsoft.com/en-us/azure/cosmos-db/consistency-levels
QUESTION NO: 3
Hotspot Question
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.

Hotspot Question
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.

Correct Answer:

QUESTION NO: 4
You are working on an app that will save the device metrics produced every minute by various IoT devices.
You decide to collect the data for two entities; the devices and the device metrics produced by each device.
You were about to create two containers for these identified entities but suddenly your data engineer suggests placing both entities in a single container, not in two different containers.
What would you do?
You are working on an app that will save the device metrics produced every minute by various IoT devices.
You decide to collect the data for two entities; the devices and the device metrics produced by each device.
You were about to create two containers for these identified entities but suddenly your data engineer suggests placing both entities in a single container, not in two different containers.
What would you do?
Correct Answer: B
Explanation: Only visible for Pass4Test members. You can sign-up / login (it's free).
QUESTION NO: 5
Hotspot Question
You have an Azure subscription that contains an Azure Cosmos DB for NoSQL account. The account contains a container named Container1 that stores product data and stock level information.
You need to implement a stored procedure that will accept the following parameters:
- productid
- productName
- initialStockLevel
The solution must create the following:
- An item that contains the product data
- An item that contains the stock level data of each product
How should you complete the stored procedure? To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.

Hotspot Question
You have an Azure subscription that contains an Azure Cosmos DB for NoSQL account. The account contains a container named Container1 that stores product data and stock level information.
You need to implement a stored procedure that will accept the following parameters:
- productid
- productName
- initialStockLevel
The solution must create the following:
- An item that contains the product data
- An item that contains the stock level data of each product
How should you complete the stored procedure? To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.

Correct Answer:

QUESTION NO: 6
You have an Azure Cosmos DB for NoSQL account. The account hosts a container that has the change feed enabled.
You are building an app by using the Azure Cosmos DB SDK. The app will read items from the change feed by using a pull model.
You need to ensure that multiple threads can read the change feed in parallel.
What should you include?
You have an Azure Cosmos DB for NoSQL account. The account hosts a container that has the change feed enabled.
You are building an app by using the Azure Cosmos DB SDK. The app will read items from the change feed by using a pull model.
You need to ensure that multiple threads can read the change feed in parallel.
What should you include?
Correct Answer: A
Explanation: Only visible for Pass4Test members. You can sign-up / login (it's free).
QUESTION NO: 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?
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?
Correct Answer: B
QUESTION NO: 8
You have a container in an Azure Cosmos DB for NoSQL 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.
You have a container in an Azure Cosmos DB for NoSQL 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.
Correct Answer: C,D
Explanation: Only visible for Pass4Test members. You can sign-up / login (it's free).
QUESTION NO: 9
Hotspot Question
You have an Azure subscription that contains the resources shown in the following table.

You plan to use multiple SELECT statements to query Container1 by using the built-in SQL pool of Synapse1.
You need to meet the following requirements:
- Store the key for account1 in Synapse1 for use in the SELECT
- Designate the analytical store in the FROM clause of the SELECT
What should you run? To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.

Hotspot Question
You have an Azure subscription that contains the resources shown in the following table.

You plan to use multiple SELECT statements to query Container1 by using the built-in SQL pool of Synapse1.
You need to meet the following requirements:
- Store the key for account1 in Synapse1 for use in the SELECT
- Designate the analytical store in the FROM clause of the SELECT
What should you run? To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.

Correct Answer:

QUESTION NO: 10
Hotspot Question
You have an Azure Cosmos DB for NoSQL container that contains the following item.

You need to update the OrderQty value to 5 by using a patch operation.
How should you complete the JSON Patch document? To answer, select the appropriate options in the answer area.

Hotspot Question
You have an Azure Cosmos DB for NoSQL container that contains the following item.

You need to update the OrderQty value to 5 by using a patch operation.
How should you complete the JSON Patch document? To answer, select the appropriate options in the answer area.

Correct Answer:

QUESTION NO: 11
You have an Azure Cosmos DB for NoSQL account.
You run the following query against a container in the account.

What is the output of the query?
You have an Azure Cosmos DB for NoSQL account.
You run the following query against a container in the account.

What is the output of the query?
Correct Answer: C
Explanation: Only visible for Pass4Test members. You can sign-up / login (it's free).
QUESTION NO: 12
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.

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.

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




