Launch price: every exam for $29.99 a year, for the first 300 buyers. See the price

CertStreak
Menu
Microsoft Azure, expert

DP-420 practice test and mock exam

For the Building AI Applications with Azure Cosmos DB exam. Original practice questions and timed mock exams for DP-420, built from the official skills outline. Practice questions on 53 of the 56 topics listed below, with every answer explained.

Ten free questions a day, no card. Full access to every exam is one pass: $29.99 a year.

DP-420 mock exam and practice questions

Practice questions
On 53 of 56 topics
Mock exam
50 questions, 100 min
Pass mark in our mocks
70%
Kept up to date
Updated every week
Pass guarantee
With the yearly pass

DP-420 sample questions with answers explained

Three free DP-420 practice questions, each with the right answer, why it is right and the official page it comes from. For more, try 5 questions. No account needed.

Sample question 1Single answer

An ASP.NET Core minimal API uses the Microsoft.Azure.Cosmos .NET SDK with DefaultAzureCredential to read items from the product container in the cosmicworks database. Requirements:

  1. The process must use exactly one CosmosClient for its whole lifetime.
  2. The first incoming request must not pay the connection setup and routing discovery cost.
  3. The client must be disposed when the host stops.

How should you create and register the client in Program.cs?

Choose one answer
Why

Only CosmosClient.CreateAndInitializeAsync performs connection setup and routing discovery for the listed containers before any request arrives. Because the finished instance is registered with AddSingleton(client), the host will not dispose it, so the using scope must stay alive until the host stops and then dispose the client. A DI factory would be disposed automatically but defers the setup cost to the first request.

  • Not correct: Create a client with CreateAndInitializeAsync for product inside each request handler, wrapped in a using declaration. A client per request discards the connection pool and routing cache each time and breaks the one-client-per-account singleton guidance.
  • Correct: Create it with CreateAndInitializeAsync for product, register it with AddSingleton(client), and keep its using scope alive until the host stops. CreateAndInitializeAsync prefetches routing metadata at startup, one instance is shared, and the using scope disposes the existing instance when the host stops.
  • Not correct: Register AddSingleton<CosmosClient> with a factory delegate that constructs the client and calls GetContainer for product. GetContainer is a zero-network call that returns a logical handle, so it warms nothing, and the deferred factory still leaves connection setup to the first request.
  • Not correct: Create it with CreateAndInitializeAsync for product, register it with AddSingleton(client), and add no shutdown code. An existing instance registered with AddSingleton(client) is not disposed by the host; disposal remains the caller's responsibility.
  • Not correct: Register AddSingleton<CosmosClient> with a factory delegate that calls the CosmosClient constructor, and add no shutdown code. The factory defers construction, and the .NET constructor makes no network calls, so the first request that uses Azure Cosmos DB pays for connection setup and routing discovery.
Sample question 2Single answer

Contoso is creating an Azure Cosmos DB for NoSQL container named orders for its storefront. Each order is stored as one item. The following facts apply:

  • About 2 million customers place orders, and the largest customer's order history is under 50 MB.
  • Orders are sold in 12 countries. Orders from one country are projected to reach about 300 GB within three years.
  • The customerId and countryCode values on an order never change.
  • The orderStatus property changes from Open to Shipped to Delivered during an order's life.
  • The order-tracking page is the highest-frequency operation. It runs the query in the exhibit with both parameter values supplied.

The partition key must keep the order-tracking query on a single logical partition, must use a property whose value never changes after the item is created, and must not let any single key value approach the logical partition storage limit.

SELECT * FROM c WHERE c.countryCode = @countryCode AND c.customerId = @customerId AND c.orderStatus = 'Open'

Which partition key path should you choose for the orders container?

Choose one answer
Why

Each candidate must satisfy three criteria at once: presence in the hottest equality filter, immutability, and per-value storage well below the 20 GB logical partition ceiling. The item ID meets the last two but is absent from the query, so the query fans out. The order status is in the query but changes during the order's life, and partition key values cannot be updated in place. The country code is in the query and stable, but one country's projected 300 GB far exceeds what a single logical partition can hold, whereas customerId meets all three requirements.

  • Not correct: /id. The item ID is high cardinality and never changes, but the order-tracking query does not filter on it, so the query fans out to every physical partition.
  • Not correct: /countryCode. The country code is in the filter and does not change, but one logical partition holds up to 20 GB, and writes for a value that reaches that ceiling stop, so the largest country would hit the limit.
  • Not correct: /orderStatus. The status is in the query filter, but partition key values cannot be updated in place; moving an order to a new status would require creating a new item and deleting the old one, which is not atomic across logical partitions.
  • Correct: /customerId. customerId is an equality filter in the hottest query, so that query routes to one logical partition; a customer's ID on an order does not change, and the largest customer's data is far below the 20 GB per-value ceiling.
Sample question 3Multiple answers

Contoso runs a .NET change feed processor against the productMeta container in an Azure Cosmos DB account replicated to West Europe and North Europe. One Azure Kubernetes Service (AKS) pod in West Europe runs today with the configuration shown in the exhibit. The lease container currently holds eight leases.

You will add two more pods that run the same container image in the same AKS cluster. The processor name is hard-coded in the image. The instance name, lease container and client endpoint are read from per-pod configuration.

Requirements:

  1. The three pods must divide the leases, with one owner per lease at a time.
  2. The new pods must resume from the workload's existing checkpoints rather than initialize independent processing state. Duplicate delivery after a failure is acceptable.
  3. Every pod must read from the West Europe region while that region is available.
SettingValue
processorNamecategoryNameSync (hard-coded in the image)
Instance namecatalog-worker-1
Lease containerleases (partition key /id)
Client endpointhttps://contoso-catalog.documents.azure.com:443/
ApplicationPreferredRegionsWest Europe

Which three settings should you configure for the two new pods? Each correct answer presents part of the solution. Select three.

Choose 3 answers.
Why

Instances divide the workload when they share a lease container and processor name and have distinct instance names. Each lease has one owner at a time, but processing remains at least once, so failures can cause duplicate delivery. Using the existing global endpoint preserves the lease namespace, while ApplicationPreferredRegions selects West Europe for reads. A regional endpoint creates independent lease state instead of continuing from the existing checkpoints.

Try 5 free DP-420 questions, no account

What the DP-420 exam covers

Bars show about how much of the exam each domain is. Mock exams follow the same weights.

The DP-420 topics

Design and develop database solutions (27 topics)
Evaluate resource models and SDK solutionsEvaluate consistency levelsEvaluate Request Unit (RU) consumption requirementsEvaluating and configuring appropriate throughputConfigure account-level and container-level settingsCreate and manage database and containersInitialize SDK clients and connectionsImplement database operationsImplement queries, parameterized queries, paging, and continuation tokensImplement point read operationsImplement create, replace, update, patch and delete operationsImplement bulk, batch, and transactional operationsConfigure Time to Live (TTL)Implement concurrency control mechanismsDesign and implement data models and partitioning strategiesDesign data models for access patterns and operational requirementsDesign and select partition keys based on cardinality, access patterns, and write distribution requirementsDetermine when to embed or reference related dataEvaluate the impact of partition key selection on scalability and performanceImplement hierarchical partition keys (HPKs) and multi-tenant partitioning strategiesImplement synthetic partition keysIdentify partitioning anti-patterns and partitioning issues during solution reviewsEstimate workload cost requirementsImplement change feedImplement change feed operationsDifferentiate between change feed processor and pull mode modelsConfigure lease containersImplement change feed processing using latest mode or all versions and deleteImplement copy container jobs (no questions yet)Design and implement Azure Cosmos DB solutions by using AI-assisted toolsImplement Agent Kit to follow Azure Cosmos DB development recommended solutionsImplement Agent Kit to accelerate AI application development (no questions yet)
Secure, optimize, and deploy database solutions (15 topics)
Implement database security controlsConfigure authentication mechanismsConfigure authorization controlsConfigure network securityConfigure dynamic data maskingImplement availability and recovery solutionsConfigure backup and restore solutionsImplement multi-region read and write configurationsConfigure partition failover solutionsOptimize and remediate database performanceOptimize query performanceAnalyze query performance metricsAnalyze index performance metricsMonitor end-to-end latency against service objectivesConfigure Azure Monitor alertsAnalyze diagnostic logs in Log AnalyticsImplement Fleet management and monitoring across multiple accounts and subscriptionsConfigure Fleet level throughput managementConfigure Fleet monitoring with fleet analytics (no questions yet)
Implement AI and analytics capabilities in database solutions (14 topics)

DP-420 practice test: frequently asked questions

Is there a free DP-420 practice test?

Yes. 5 DP-420 questions need no account, and every answer is explained after you pick it. The free plan adds ten questions a day, and there is a free DP-420 question of the day.

Are these real DP-420 exam questions?

No. The questions are our own, written from Microsoft Azure's official documentation. Each answer links the page it comes from, so you can check it.

How long is the DP-420 mock exam?

50 questions in 100 minutes, the exam time Microsoft Azure publishes. Each domain is weighted as on the real exam, and the mock is timed so you practise pace as well as content.

What score do I need to pass DP-420?

In our mocks the pass line is 70%. Microsoft Azure marks the real exam on its own scaled score, so treat a practice percentage as a guide to readiness, not a prediction. The official study guide lists the real passing score.

How current are the DP-420 questions?

The question bank is updated every week, and every answer cites an official Microsoft Learn page, so you can see where the explanation comes from.

The pass guarantee covers DP-420

Reach 90% on every skill, keep it fresh within 14 days of your exam, and still fail? Your money back or a free extra year.

Read the conditions

Start your DP-420 streak today.

Try DP-420 free