Practice mode

DP-420 practice questions with explanations

10 free questions for the Building AI Applications with Azure Cosmos DB exam. Choose an answer, check it, and read why it is right. No account needed.

DP-420 exam guide

These 10 free DP-420 practice questions show you where you stand on the Building AI Applications with Azure Cosmos DB exam. Each one has the correct answer and an explanation of why it is right, so you learn the reasoning and not only the answer. The DP-420 outline has 3 domains, led by Design and develop database solutions (40–45%), Secure, optimize, and deploy database solutions (30–35%), Implement AI and analytics capabilities in database solutions (20–25%). Use your results to decide which domain to study next, then read the DP-420 exam guide for the skills Microsoft lists and a 2-week study plan. When you want more, the DP-420 practice test plans add the full bank of 51 questions and a timed exam mode.

Showing questions 1-10 of 10 free questions

Question 1

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?

Choose one answer for question 1

Answer and explanation

Correct answer: C

Bounded staleness is frequently chosen by globally distributed applications that expect low write latencies but require total global order guarantee. Bounded staleness is great for applications featuring group collaboration and sharing, stock ticker, publish-subscribe/queueing etc.

Scenario: 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.

Reference: https://docs.microsoft.com/en-us/azure/cosmos-db/consistency-levels

Question 2

You need to select the partition key for con-iot1. The solution must meet the IoT telemetry requirements.

What should you select?

Choose one answer for question 2

Answer and explanation

Correct answer: D

The partition key is what will determine how data is routed in the various partitions by Cosmos DB and needs to make sense in the context of your specific scenario. The IoT Device ID is generally the "natural" partition key for IoT applications.

Scenario: The iotdb database will contain two containers named con-iot1 and con-iot2. Ensure that Azure Cosmos DB costs for IoT-related processing are predictable.

Question 3

You need to identify which connectivity mode to use when implementing App2. The solution must support the planned changes and meet the business requirements.

Which connectivity mode should you identify?

Choose one answer for question 3

Answer and explanation

Correct answer: C

Scenario: 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.

By using Azure Private Link, you can connect to an Azure Cosmos account via a private endpoint. The private endpoint is a set of private IP addresses in a subnet within your virtual network.

When you're using Private Link with an Azure Cosmos account through a direct mode connection, you can use only the TCP protocol. The HTTP protocol is not currently supported.

Reference: https://docs.microsoft.com/en-us/azure/cosmos-db/how-to-configure-private-endpoints

Question 4

You configure multi-region writes for account1.

You need to ensure that App1 supports the new configuration for account1. The solution must meet the business requirements and the product catalog requirements.

What should you do?

Choose one answer for question 4

Answer and explanation

Correct answer: D

App1 queries the con-product and con-productVendor containers.

Note: Request unit is a performance currency abstracting the system resources such as CPU, IOPS, and memory that are required to perform the database operations supported by Azure Cosmos DB.

Scenario:

Develop an app named App1 that will run from all locations and query the data in account1. Once multi-region writes are configured, maximize the performance of App1 queries against the data in account1.

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.

Reference: https://docs.microsoft.com/en-us/azure/cosmos-db/consistency-levels

Question 5

You have an application named App1 that reads the data in an Azure Cosmos DB Core (SQL) API account. App1 runs the same read queries every minute. The default consistency level for the account is set to eventual.

You discover that every query consumes request units (RUs) instead of using the cache.

You verify the IntegratedCacheiteItemHitRate metric and the IntegratedCacheQueryHitRate metric.

Both metrics have values of 0.

You verify that the dedicated gateway cluster is provisioned and used in the connection string.

You need to ensure that App1 uses the Azure Cosmos DB integrated cache. What should you configure?

Choose one answer for question 5

Answer and explanation

Correct answer: C

Because the integrated cache is specific to your Azure Cosmos DB account and requires significant CPU and memory, it requires a dedicated gateway node. Connect to Azure Cosmos DB using gateway mode.

Reference: https://docs.microsoft.com/en-us/azure/cosmos-db/integrated-cache-faq

Question 6

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?

Choose one answer for question 6

Answer and explanation

Correct answer: D

Use a partition key with a random suffix. Distribute the workload more evenly is to append a random number at the end of the partition key value. When you distribute items in this way, you can perform parallel write operations across partitions.

Incorrect Answers:

A: You will also not like to partition the data on “DateTime”, because this will create a hot partition. Imagine you have partitioned the data on time, then for a given minute, all the calls will hit one partition. If you need to retrieve the data for a customer, then it will be a fan-out query because data may be distributed on all the partitions.

B: Senser1Value has only two values.

C: All the devices could have the same manufacturer.

Reference: https://docs.microsoft.com/en-us/azure/cosmos-db/sql/synthetic-partition-keys

Question 7

You maintain a relational database a book publisher. The database contains the following tables. You maintain a relational database a book publisher. The database contains the following tables.

The most common query lists the books for a given authorId.

You need to develop a non-relational data model for Azure Cosmos DB Core (SQL) API that will replace the relational database. The solution must minimize latency and read operation costs. What should you include in the solution?

A. Create a container for Author and a container for Book. In each Author document, embed bookId for each book by the author. In each Book document embed authorId of each author. B. Create Author, Book, and Bookauthorlnk documents in the same container.

Choose one answer for question 7

Answer and explanation

Correct answer: A

Store multiple entity types in the same container.

Question 8

You have an Azure Cosmos DB Core (SQL) API account.

You run the following query against a container in the account.

SELECT

IS_NUMBER("1234") AS A,

IS_NUMBER(1234) AS B, IS_NUMBER({prop: 1234}) AS C What is the output of the query?

Choose one answer for question 8

Answer and explanation

Correct answer: A

IS_NUMBER returns a Boolean value indicating if the type of the specified expression is a number.

"1234" is a string, not a number.

Reference: https://docs.microsoft.com/en-us/azure/cosmos-db/sql/sql-query-is-number

Question 9

You need to implement a trigger in Azure Cosmos DB Core (SQL) API that will run before an item is inserted into a container.

Which two actions should you perform to ensure that the trigger runs? Each correct answer presents part of the solution.

NOTE: Each correct selection is worth one point.

Choose one answer for question 9

Answer and explanation

Correct answer: C

C: When triggers are registered, you can specify the operations that it can run with.

F:Whenexecuting,pre-triggersarepassedintheRequestOptionsobjectbyspecifying PreTriggerInclude and then passing the name of the trigger in a List object.

Reference: https://docs.microsoft.com/en-us/azure/cosmos-db/sql/how-to-use-stored-procedurestriggers-udfs

Question 10

Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might have more than one correct solution, while others might not have a correct solution.

After you answer a question in this section, you will NOT be able to return to it. As a result, these questions will not appear in the review screen.

You have an Azure Cosmos DB Core (SQL) API account named account 1 that uses autoscale throughput.

You need to run an Azure function when the normalized request units per second for a container in account1 exceeds a specific value.

Solution: You configure an Azure Monitor alert to trigger the function. Does this meet the goal?

Choose one answer for question 10

Answer and explanation

Correct answer: A

You can set up alerts from the Azure Cosmos DB pane or the Azure Monitor service in the Azure portal.

Note: Alerts are used to set up recurring tests to monitor the availability and responsiveness of your Azure Cosmos DB resources. Alerts can send you a notification in the form of an email, or execute an Azure Function when one of your metrics reaches the threshold or if a specific event is logged in the activity log.

Reference: https://docs.microsoft.com/en-us/azure/cosmos-db/create-alerts

Want more than 10 questions?

The full DP-420 bank has 51 questions and adds a timed exam mode, per-topic review and a printable PDF. Plans start from $35.