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 in source order, with options supported by the source format, 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

Supported languages

  • English
  • Simplified Chinese
Try before you buy

First 20 practice questions

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 16

Question#16Topic1

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

  1. A. orderId
  2. B. customerId
  3. C. orderDate
  4. D. id
Show answer and explanation

Answer

B

Explanation

customerId is the optimal partition key because customers frequently view their past order history — all orders for one customer share the same partition key, enabling efficient single-partition queries with minimal RU cost. orderId would scatter each order into its own partition, making customer history queries cross-partition. orderDate creates hot partitions (all orders on the same date) and cross-partition queries for customer-specific lookups.

Question 17

Question#17Topic1

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

  1. A. You will exceed the maximum number of partition key values
  2. B. You will exceed the maximum storage per partition
  3. C. There will always be a hot partition
  4. D. Queries will run cross-partition
Show answer and explanation

Answer

CD

Explanation

Using orderDate as the partition key with 1 million orders daily causes all that day's writes to target the same logical partition, creating a persistent hot partition (C). Customer order history queries filter by customerId, not orderDate, forcing expensive cross-partition fan-out queries (D). You will not exceed maximum partition key values (A) because dates provide sufficient cardinality, and 2 KB documents alone may not immediately exceed 20 GB per partition (B) though hot-partition throttling is the primary concern.

Question 18

Question#18Topic1

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?

  1. A. Update the document of each family member separately by using a patch operation
  2. B. Update the document of each family member separately and set the consistency level to strong
  3. C. Update the document of each family member by using a transactional batch operation
Show answer and explanation

Answer

C

Explanation

Transactional batch operations in Azure Cosmos DB provide ACID guarantees for multiple operations within the same logical partition (same partition key value). All family members share familyId as the partition key, so updating each member's address in one transactional batch is atomic, consistent, isolated, and durable with the lowest latency. Separate patch or update operations are not atomic across documents, and strong consistency alone does not provide cross-document atomicity.

Question 19

Question#19Topic1

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. Create a new synthetic key that contains deviceId and timestamp
  2. B. Use timestamp as the partition key
  3. C. Use deviceManufacturer as the partition key
  4. D. Use sensor1Value as the partition key
Show answer and explanation

Answer

A

Explanation

With writes every second per IoT device, deviceId alone can concentrate sustained write load on one logical partition per device. A synthetic key combining deviceId and timestamp distributes writes across time-based sub-partitions for each device, reducing hot-partition risk and partition skew while maintaining queryability by device. Timestamp alone creates global hot partitions; deviceManufacturer and sensor1Value have insufficient cardinality for even write distribution.

Question 20

Question#20Topic1

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?

  1. A. In a directory container, create a document for each company and a document for each user. Use the company ID as the partition key.
  2. B. Create 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.
  3. C. In a user container, create a document for each user. Embed the company into each user document. Use the user ID as the partition key.
  4. D. In a company container, create a document for each company. Embed the users into company documents. Use the company ID as the partition key.
Show answer and explanation

Answer

D

Explanation

The workload is read-optimized: browse by company, browse users by company, and show company details with all related users in one view. Embedding users in company documents within a company container partitioned by companyId delivers all required data in a single point read per company page. Separate user/company containers require multiple round trips; embedding company in user documents makes company browsing cross-partition; each company has fewer than 1,000 users, keeping documents within practical size limits.

Downloads and personal use

  • Purchase this exam question set separately with 1, 3, 6 or 12 months of download access.
  • After payment confirmation, your library shows the download link and exact expiry time.
  • 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