10 exam-style questions with answers and explanations, straight from our 1,030-question bank. Tap an answer to check yourself. When you're ready, take the scored version in the free practice test.
These 10 free DP-420 questions are organized by exam domain, so you can see how each part of the Microsoft Certified: Azure Cosmos DB AI Developer Associate (DP-420) blueprint is tested. Reveal the answer and explanation under each question.
Domain 1: Design and develop database solutions (40-45%)
Question 1
An order-lookup endpoint uses Azure Cosmos DB for NoSQL. Every request supplies orderId and customerId, and the container is partitioned by /customerId. The endpoint returns the complete order document using this parameterized query:
SELECT * FROM c WHERE c.id = @orderId AND c.customerId = @customerId
The team wants to reduce the RU charge per lookup without changing the data model or consistency level. Which implementation change directly addresses that goal?
Show answer & explanation
Correct answer: B - Use a point read with item ID orderId and partition-key value customerId.
Question 2
Session-consistent reads pass on one web server but fail intermittently after horizontal scaling. A request trace shows:
1. Server A writes an address change and receives success.
2. The customer's next request reaches server B and reads the previous address.
Each server reuses its own CosmosClient against the same Cosmos DB for NoSQL account; neither caches documents. Which change preserves read-your-writes while retaining Session consistency and unrestricted load balancing?
Show answer & explanation
Correct answer: A - Forward the write response's session token and supply it on the subsequent read for that partition.
Question 3
A read-heavy SaaS application is redesigning its Azure Cosmos DB for NoSQL event container. It has 5,000 tenants; a large tenant retains 65 GB of events spread across thousands of users, while each tenant-user pair stays below 500 MB. Most reads specify both tenantId and userId, but tenant-wide reports must also avoid querying unrelated tenants' partitions. Which partition-key definition accommodates the large tenants while preserving efficient tenant-prefix routing?
Show answer & explanation
Correct answer: C - A hierarchical partition key ordered as /tenantId, then /userId.
Question 4
Two dispatchers read the same shipment item from a single-write-region Azure Cosmos DB for NoSQL account. One saves revised delivery instructions. The other then attempts to replace the item to assign a courier, using the ETag from the earlier read in If-Match, and receives HTTP 412. The application must preserve the revised instructions and continue accepting concurrent work on other shipments. What should its conflict-handling path do?
Show answer & explanation
Correct answer: D - Read the current item, reapply the courier change if still valid, and retry with its new ETag.
Question 5
Completing an order requires two writes: patch the order's status and create a separate outbox item for downstream processing. Both items are in the same Azure Cosmos DB for NoSQL container and have the same orderId partition-key value. The writes are small, and a crash between them must never leave the order completed without its outbox item. Select the implementation that provides the required commit behavior.
Show answer & explanation
Correct answer: A - Execute the status patch and outbox create in one transactional batch for that orderId.
Domain 2: Secure, optimize, and deploy database solutions (30-35%)
Question 6
A reporting worker obtains a valid Microsoft Entra token through its managed identity and can reach an Azure Cosmos DB for NoSQL account. Its Azure Reader role lets the team inspect the account, but SDK queries are denied. The worker must read and query only the invoices container in the billing database, with no item-write permission. Which additional assignment grants the required data access at the narrowest scope?
Show answer & explanation
Correct answer: C - Cosmos DB Built-in Data Reader at billing/invoices container scope.
Question 7
At 14:00 UTC, a deployment script incorrectly overwrites invoice balances in a production, dedicated-throughput Azure Cosmos DB for NoSQL container. By 14:20, the changes have reached every account region. The script has been stopped. Continuous backup was enabled before the incident, and 13:59:30 UTC is a verified restorable point containing the correct balances. The incident commander needs a clean copy to validate and selectively reconcile with production, preserving the live account for investigation. Which recovery operation should be initiated?
Show answer & explanation
Correct answer: A - Restore the container into a new account at 13:59:30 UTC; validate that copy before reconciliation.
Question 8
During the daily peak, Azure Monitor shows HTTP 429 for 2.5% of request attempts against a provisioned-throughput Cosmos DB for NoSQL container. Partition-level measurements show an even workload distribution. SDK retries succeed, there are no terminal request failures, and end-to-end p99 latency remains 140 ms against a 250 ms service objective. A proposal would pause ingestion whenever a 429 appears. What operating decision is supported by these measurements?
Show answer & explanation
Correct answer: D - Retain throughput and retries; monitor terminal failures and end-to-end tail latency.
Domain 3: Implement AI and Analytics capabilities in database solutions (20-25%)
Question 9
Testing a support-document search reveals complementary weaknesses: full-text search ranks exact fault-code matches well but misses paraphrased symptoms, while vector search recognizes paraphrases but sometimes ranks exact-code matches poorly. The Azure Cosmos DB for NoSQL container has both indexes configured. The team needs a single ranking that combines both signals without assuming their raw scores are comparable. What belongs in the retrieval query?
Show answer & explanation
Correct answer: D - Combine FullTextScore and VectorDistance through RRF in an ORDER BY RANK clause.
Question 10
An engineering team must search 600,000 document embeddings in Azure Cosmos DB for NoSQL. Each vector has 1,536 float32 dimensions, and all 600,000 vectors remain candidates after filtering. The design accepts approximate nearest neighbors but must avoid exhaustively comparing the query with every candidate vector. Which indexing choice satisfies those requirements?
Show answer & explanation
Correct answer: B - A diskANN vector index on the complete 1,536-dimensional embedding path.
That's 10 of 1,030
The full bank has 1,020 more DP-420 questions with explanations.