Home / Microsoft / DP-420
Microsoft · DP-420

DP-420 Exam Practice Questions

Azure Cosmos DB AI Developer

DP-420 English PDF practice questions: 271 questions with answers and available explanations. Access covers this exam only. One-time payment; no automatic renewal.

Exam overview

For developers modeling, querying and optimizing Azure Cosmos DB data, including support for AI applications.

Exam code
DP-420
Official exam / credential
Azure Cosmos DB AI Developer
Exam format
Proctored assessment; interactive items may be included
Exam duration
100 minutes
Official exam languages
English, Japanese, Simplified Chinese, Korean, German, French, Spanish, Portuguese (Brazil), Traditional Chinese, Italian

Official exam languages and practice-question file languages are listed separately. Confirm the exam version and available languages when booking with the provider.

Official sources: Provider reference
Information checked: 2026-10-20

How to prepare for DP-420

Start with the provider’s current objectives as a checklist, then test whether you can explain each topic and apply it in a practical setting. Use the free sample questions as a diagnostic for finding the areas that need review.

  1. Attempt the question before opening its answer and explanation.
  2. For every missed question, verify the underlying concept with official documentation or hands-on practice instead of memorising an answer.
  3. Before booking, recheck the exam code, version and available test languages on the provider’s official page.

View the free sample questions · Build a PDF study plan

Supported languages

  • English
  • Simplified Chinese
Try before you buy

First 20 practice questions

This page shows free preview questions 6–10.

271 total questions

Questions follow the source order. Expand each answer to see its explanation.

Disclaimer: All questions on ExamPico are compiled from internet sources and are provided for study reference only.

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.
Question illustration
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?

  1. A. Use timestamp as the partition key.
  2. B. Create a new synthetic key that contains deviceId and sensor1Value.
  3. C. Create a new synthetic key that contains deviceId and deviceManufacturer.
  4. D. Create a new synthetic key that contains deviceId and a random number.
Show answer and explanation

Answer

D

Explanation

For high-frequency IoT writes (every second), a partition key of deviceId alone can create a hot logical partition per device and risk hitting the 20 GB partition storage limit over time. Timestamp, sensor values, and deviceManufacturer have low or skewed cardinality and worsen hot-partition risk. Microsoft recommends synthetic partition keys with a random suffix (deviceId + random number) to spread writes across multiple logical partitions, minimizing skew, avoiding hot partitions, and preventing capacity limits per partition.

Question 7

You maintain a relational database for a book publisher. The database contains the following tables.
Question illustration
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?

  1. 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.
  2. B. Create Author, Book, and Bookauthorlnk documents in the same container.
  3. C. Create a container that contains a document for each Author and a document for each Book. In each Book document, embed authorId.
  4. D. Create a container for Author and a container for Book. In each Author document and Book document embed the data from Bookauthorlnk.
Show answer and explanation

Answer

C

Explanation

The most common query lists books for a given authorId. A single container with Book documents that embed authorId, partitioned by authorId, enables efficient single-partition queries (WHERE authorId = X) with minimal RU cost and low latency. Separate containers require cross-container reads; bidirectional embedding (A) increases write cost; normalized link documents (B, D) require multiple queries or joins, increasing read latency and RU consumption.

Question 8

You have an Azure Cosmos DB Core (SQL) API account.
You run the following query against a container in the account.
Question illustration
What is the output of the query?

  1. A. [{"A": false, "B": true, "C": false}]
  2. B. [{"A": true, "B": false, "C": true}]
  3. C. [{"A": true, "B": true, "C": false}]
  4. D. [{"A": true, "B": true, "C": true}]
Show answer and explanation

Answer

A

Explanation

The standard DP-420 query uses IS_NUMBER() on three expressions: IS_NUMBER("1234") returns false because the literal is a string, not a numeric type; IS_NUMBER(1234) returns true because 1234 is a number; IS_NUMBER({prop: 1234}) returns false because the input is an object, not a scalar number. The output is [{"A": false, "B": true, "C": false}].

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.

  1. A. Append pre to the name of the JavaScript function trigger.
  2. B. For each create request, set the access condition in RequestOptions.
  3. C. Register the trigger as a pre-trigger.
  4. D. For each create request, set the consistency level to session in RequestOptions.
  5. E. For each create request, set the trigger name in RequestOptions.
Show answer and explanation

Answer

CE

Explanation

To run a server-side trigger before insert in Azure Cosmos DB Core (SQL) API: (1) Register the trigger with triggerOperation = "pre" (pre-trigger) when creating it via the SDK or portal — you do not append "pre" to the function name (A is wrong). (2) For each create request, specify the trigger name in RequestOptions.TriggerName so the engine invokes it. Access conditions (B) are for optimistic concurrency, and consistency level (D) does not control trigger execution.

Question 10

HOTSPOT -
You have a container in an Azure Cosmos DB Core (SQL) API account.
You need to use the Azure Cosmos DB SDK to replace a document by using optimistic concurrency.
What should you include in the code? To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.
Hot Area:
Question illustration

Show answer and explanation

Answer

AA

Explanation

Optimistic concurrency uses RequestOptions.AccessCondition with the document _etag value.

Downloads and personal use

  • Purchase this exam question set separately with 1, 3, 6 or 12 months of download access.
  • After payment confirmation, My Library shows the generation status. We will email you when your PDF is ready to download.
  • Download again during your term. Purchase a new term after expiry.
  • PDFs are licensed for personal study only and must not be resold or shared publicly.
  • Files already saved to your device are not remotely deleted when access expires.
How to choose your certification