Microsoft Certified: Azure Cosmos DB Developer Specialty

Question bank

Microsoft logo

Microsoft Certified: Azure Cosmos DB Developer Specialty

DP-420

43 Microsoft Certified: Azure Cosmos DB Developer Specialty questions with the correct answer and a written explanation, organised across 5 exam domains.

43 questions
5 domains
Foundation level

Question index

Jump straight to any question. Answers and explanations are inline.

Design and implement data distribution

4 questions in this domain

  1. Question 1Single Choice

    Which consistency level is not supported when an Azure Cosmos DB account has multiple write regions enabled?

    • AStrongCorrect answer
    • BSession
    • CEventual
    • DConsistent Prefix

    Why this is the answer

    Strong consistency is not supported with multiple write regions because it requires synchronous global ordering. Only Session, Consistent Prefix, and Eventual are supported in this scenario.

  2. Question 2Multiple Select

    Which statements about the failover priority list for an Azure Cosmos DB single-write multi-region account are correct? Select all that apply.

    • AOne region must be assigned priority 0 as the current write region.Correct answer
    • BEvery region must have a unique integer failover priority.Correct answer
    • CThe list is used to route read requests to the nearest region.
    • DAutomatic failover is enabled by default when a region is added.

    Why this is the answer

    The priority list designates the write region and failover order; priorities must be unique. It does not control read routing, and automatic failover is not enabled by default.

  3. Question 3Interactive

    Review the ARM template snippet. Based on the settings shown, which statement correctly describes the configured behavior?

    • AWest US is the write region, and East US is first in line to become the write region if a failover occurs.Correct answer
    • BEast US is the write region, and West US is the next failover region.
    • CCentral US is the write region, and all regions can accept writes.
    • DAutomatic failover is disabled, and all regions share write priority.

    Why this is the answer

    In the template, failoverPriority 0 marks West US as the write region. enableAutomaticFailover true allows East US, priority 1, to be promoted if West US fails.

  4. Question 4Single Choice

    What is the default conflict resolution policy for an Azure Cosmos DB container when multiple write regions are enabled?

    • ALast-Writer-Wins using the system timestampCorrect answer
    • BCustom stored procedure
    • CConflict feed processing
    • DStrong consistency-based merge

    Why this is the answer

    Cosmos DB uses Last-Writer-Wins by default based on the item's system timestamp. Custom stored procedures and the conflict feed are alternatives, not defaults.

Design and implement data models

16 questions in this domain

  1. Question 5Single Choice

    Which option states the maximum size of a single document in Azure Cosmos DB?

    • A1 MB
    • B2 MBCorrect answer
    • C4 MB
    • D10 GB

    Why this is the answer

    The maximum item size in Azure Cosmos DB is 2 MB. Documents that exceed this limit must be redesigned using splitting or referencing.

  2. Question 6Multiple Select

    Which two statements about denormalization in Azure Cosmos DB are true?

    • AData duplication is acceptable and often needed for efficient reads.Correct answer
    • BThe change feed can synchronize duplicated data.Correct answer
    • CNormalization is the primary design goal.
    • DUse server-side JOINs across containers to avoid duplication.

    Why this is the answer

    Denormalization reduces round trips and RU cost. Cosmos DB intentionally duplicates data, and the change feed can keep copies synchronized.

  3. Question 7Interactive

    Review the stored procedure in the code block. What is required for it to update multiple documents in one transaction?

    • AAll documents must share the same partition key value.Correct answer
    • BAll documents must be in different containers.
    • CAll documents must have the same id.
    • DAll documents must be indexed manually.

    Why this is the answer

    Stored procedures in Azure Cosmos DB execute within a single logical partition. Therefore, every document updated atomically must have the same partition key value.

  4. Question 8Single Choice

    What is the primary purpose of a partition key in Azure Cosmos DB?

    • ATo route items to physical partitionsCorrect answer
    • BTo set the consistency level
    • CTo define the indexing mode
    • DTo enforce unique ids globally

    Why this is the answer

    The partition key determines the logical partition and is hashed to route items to the correct physical partition for storage and queries.

  5. Question 9Multiple Select

    Which two characteristics should a good partition key have?

    • AHigh cardinalityCorrect answer
    • BEven distribution of data and throughputCorrect answer
    • CLow number of distinct values
    • DFrequent value changes

    Why this is the answer

    A good partition key has many unique values and spreads both storage and request traffic evenly across physical partitions.

  6. Question 10Interactive

    Which two statements about the indexing policy shown in the code block are correct?

    • AThe /name property is indexed.Correct answer
    • BThe /description property can still be queried, but may require a scan.Correct answer
    • CThe /description property cannot be queried.
    • DThe indexing mode is set to None.

    Why this is the answer

    Included paths index the /name property. Excluded paths remove /description from the index, but queries can still run through full scans, although less efficiently.

  7. Question 11Single Choice

    Which consistency level is the default for most Azure Cosmos DB SDK operations?

    • AStrong
    • BBounded staleness
    • CSessionCorrect answer
    • DEventual

    Why this is the answer

    Session consistency is the default for most SDK calls and provides read-your-writes within a client session.

  8. Question 12Multiple Select

    Which two consistency levels are not supported when the account has multiple write regions?

    • AStrongCorrect answer
    • BBounded stalenessCorrect answer
    • CSession
    • DEventual

    Why this is the answer

    Strong and Bounded staleness require a single write region. Multi-region write accounts support Session, Consistent prefix, and Eventual.

  9. Question 13Interactive

    Which query can be efficiently served by the composite index in the code block?

    • AWHERE tenantId = @tenant ORDER BY timestamp DESCCorrect answer
    • BWHERE tenantId = @tenant ORDER BY timestamp ASC
    • CSELECT * FROM c ORDER BY tenantId, timestamp
    • DSELECT * FROM c WHERE timestamp > @time

    Why this is the answer

    Composite indexes must match the equality property order and sort direction. This index has tenantId ascending and timestamp descending, so that query pattern matches.

  10. Question 14Single Choice

    What is the maximum storage size for a single logical partition?

    • A10 GB
    • B20 GBCorrect answer
    • C30 GB
    • D2 MB

    Why this is the answer

    Each logical partition can store up to 20 GB. Exceeding this limit makes the container unable to accept writes to that partition.

  11. Question 15Multiple Select

    Which two statements about hot partitions are correct?

    • AA hot partition can cause throttling even when total throughput is not exhausted.Correct answer
    • BNormalized RU Consumption at 100% can indicate a hot partition.Correct answer
    • CTotalRequests is the most reliable metric for detecting hot partitions.
    • DHot partitions affect storage only, not throughput.

    Why this is the answer

    Hot partitions are identified by per-partition metrics such as Normalized RU Consumption. TotalRequests alone can hide partition-level imbalance and throttling.

  12. Question 16Interactive

    Which type of operation does the code in the block perform?

    • AA point readCorrect answer
    • BA cross-partition query
    • CA stored procedure
    • DA delete operation

    Why this is the answer

    The code reads a single item by its id and partition key, which is the most efficient operation in Azure Cosmos DB.

  13. Question 17Single Choice

    How are related entities modeled in the Core SQL API?

    • ABy embedding related data or storing referencesCorrect answer
    • BBy creating foreign keys
    • CBy using cross-container joins
    • DBy using materialized tables only

    Why this is the answer

    The Core SQL API models relationships by embedding child data in the same JSON document or by storing references to other documents.

  14. Question 18Multiple Select

    Which two scenarios are good candidates for embedding related data?

    • ARelated data is always read with the parent.Correct answer
    • BThe relationship is bounded and one-to-few.Correct answer
    • CThe child collection can grow without bound.
    • DThe child data is updated independently and very often.

    Why this is the answer

    Embedding is best when related data is read together, the relationship is bounded, and atomic manipulation within a single document is useful.

  15. Question 19Interactive

    What is the scope of a JOIN in the Core SQL API, based on the query in the code block?

    • AIt can only join arrays embedded within the same item.Correct answer
    • BIt can join documents from multiple containers.
    • CIt can join a container and a database.
    • DIt can join any two documents in the same partition.

    Why this is the answer

    JOIN in Cosmos DB is limited to embedded arrays within a single JSON document. Cross-container joins are not supported.

  16. Question 20Single Choice

    What is the default conflict resolution policy for containers with multi-region writes?

    • ALast-Writer-WinsCorrect answer
    • BCustom stored procedure
    • CConflict feed only
    • DManual merge

    Why this is the answer

    Last-Writer-Wins is the default conflict resolution policy. It uses a timestamp or a custom numeric property to select the winning write.

Integrate an Azure Cosmos DB solution

4 questions in this domain

  1. Question 21Single Choice

    What is the primary purpose of the lease container in an Azure Functions Cosmos DB trigger?

    • AStores checkpoints and processing stateCorrect answer
    • BStores the original source documents
    • CCaches query results for repeat reads
    • DTemporarily stores output binding data

    Why this is the answer

    The lease container keeps checkpoints and work distribution metadata so the Change Feed Processor can resume and coordinate processing across instances.

  2. Question 22Multiple Select

    Which two statements accurately describe the behavior of Change Feed modes in Azure Cosmos DB containers?

    • ALatest mode does not include delete operationsCorrect answer
    • BAll versions and deletes must be enabled at container creationCorrect answer
    • CLatest mode includes all intermediate changes for each item
    • DAll versions and deletes mode is the default for existing containers

    Why this is the answer

    Latest mode exposes only the most recent update per item and omits deletes. Full fidelity mode must be enabled at container creation and includes delete operations.

  3. Question 23Interactive

    Review the container settings in the code block. What is the result of the analyticalStoreTtl value specified?

    • AIt enables unlimited retention for the analytical storeCorrect answer
    • BIt disables the analytical store for this container
    • CIt retains analytical data for one year
    • DIt sets the transactional store TTL

    Why this is the answer

    A value of -1 for analyticalStoreTtl enables the analytical store and retains all historical analytical versions indefinitely.

  4. Question 24Single Choice

    What is the transaction scope of a stored procedure when it runs in Azure Cosmos DB?

    • AA single logical partitionCorrect answer
    • BA single physical partition
    • CAll partitions in a container
    • DThe whole database account

    Why this is the answer

    Stored procedures are scoped to one logical partition and cannot operate across different partition key values.

Maintain an Azure Cosmos DB solution

11 questions in this domain

  1. Question 25Single Choice

    Which statement best describes encryption at rest for an Azure Cosmos DB account?

    • AAll data is encrypted automatically with AES-256 and cannot be disabled.Correct answer
    • BEncryption at rest must be enabled per container.
    • CEncryption at rest applies only to SQL API data.
    • DEncryption at rest can be turned off to improve performance.

    Why this is the answer

    Cosmos DB encrypts all data at rest by default using AES-256. The encryption is mandatory, applies to every API, and requires no configuration.

  2. Question 26Multiple Select

    Which statements about data plane RBAC for Azure Cosmos DB are true?

    • ARBAC uses Microsoft Entra ID tokens.Correct answer
    • BA role assignment can be scoped to a single container.Correct answer
    • CRBAC replaces the need to configure consistency levels.
    • DRBAC supports all Cassandra API operations.

    Why this is the answer

    Data plane RBAC uses Microsoft Entra ID tokens and supports container-level scopes. It does not alter consistency levels and is not fully supported for all APIs.

  3. Question 27Interactive

    In the Azure CLI restore command shown, which parameter must be added to restore the account to a specific point in time?

    • A--restore-timestampCorrect answer
    • B--backup-interval
    • C--retention-period
    • D--throughput

    Why this is the answer

    The --restore-timestamp parameter specifies the UTC time for point-in-time restore. Other parameters configure backup or throughput, not restore time.

  4. Question 28Single Choice

    What is the default backup mode for a new Azure Cosmos DB account?

    • APeriodic backupCorrect answer
    • BContinuous backup
    • CCustomer-managed key backup
    • DNo backup

    Why this is the answer

    Cosmos DB defaults to periodic backup, with configurable interval and retention. Continuous backup must be explicitly enabled.

  5. Question 29Multiple Select

    Which of the following are diagnostic log categories for Azure Cosmos DB?

    • ADataPlaneRequestsCorrect answer
    • BMongoRequestsCorrect answer
    • CControlPlaneRequestsCorrect answer
    • DAzureActivity

    Why this is the answer

    DataPlaneRequests, MongoRequests, and ControlPlaneRequests are Cosmos DB diagnostic categories. AzureActivity is the subscription-level activity log, not a Cosmos DB diagnostic category.

  6. Question 30Interactive

    Which value should be supplied for the --scope parameter in this RBAC role assignment command to limit access to a single container?

    • AFull container resource IDCorrect answer
    • BDatabase resource ID
    • CCosmos DB account resource ID
    • DSubscription resource ID

    Why this is the answer

    The scope for a role assignment determines the accessible resource. A container resource ID restricts the principal to that specific container.

  7. Question 31Single Choice

    Which network feature gives a Cosmos DB account a private IP address inside a virtual network?

    • APrivate endpointCorrect answer
    • BIP firewall
    • CService tag
    • DTLS 1.2

    Why this is the answer

    A private endpoint assigns a private IP from a VNet subnet and uses Private Link. IP firewalls and service tags do not provide a private IP.

  8. Question 32Multiple Select

    Which requirements must be met before configuring customer-managed keys for Azure Cosmos DB?

    • AKey Vault soft delete and purge protection enabledCorrect answer
    • BSystem-assigned managed identity with crypto permissionsCorrect answer
    • CPublic network access enabled
    • DContinuous backup enabled

    Why this is the answer

    CMK requires purge protection and a managed identity with wrap and unwrap permissions. It does not require public access or continuous backup.

  9. Question 33Interactive

    What is the effect of the backup-policy-type parameter in this account creation command?

    • AEnables continuous backupCorrect answer
    • BEnables periodic backup
    • CEnables customer-managed keys
    • DEnables private endpoint

    Why this is the answer

    Continuous is the backup-policy-type value for continuous backup. Other settings are configured separately.

  10. Question 34Single Choice

    What is the recovery point objective for a multi-region write Cosmos DB account during a regional outage?

    • A0Correct answer
    • BUp to 5 minutes
    • CLess than 1 hour
    • DDependent on consistency level

    Why this is the answer

    Multi-region writes allow remaining write regions to accept writes with no data loss, so RPO is 0 during a regional outage.

  11. Question 35Multiple Select

    Which statements about restoring a continuous backup are true?

    • AThe restore creates a new Cosmos DB account.Correct answer
    • BRestore can use a timestamp within the retention window.Correct answer
    • CRestore can overwrite the existing account.
    • DThe source account remains unchanged.Correct answer

    Why this is the answer

    Restores always create a new account, can target any second in retention, and do not modify the source account.

Optimize an Azure Cosmos DB solution

8 questions in this domain

  1. Question 36Single Choice

    Which Azure Monitor metric shows the percentage of provisioned throughput consumed by a Cosmos DB container?

    • ANormalizedRUConsumptionCorrect answer
    • BTotalRequestUnits
    • CServerSideLatency
    • DReplicationLatency

    Why this is the answer

    NormalizedRUConsumption divides consumed RU by provisioned capacity and supports filters by physical partition, making it the correct metric for throughput saturation.

  2. Question 37Multiple Select

    Which two Azure Monitor platform metrics are available for an Azure Cosmos DB account?

    • ATotalRequestsCorrect answer
    • BTotalRequestUnitsCorrect answer
    • CCDBPartitionKeyRUConsumption
    • DQueryRuntimeStatistics

    Why this is the answer

    TotalRequests and TotalRequestUnits are account-level platform metrics published to Azure Monitor. PartitionKeyRUConsumption is a diagnostic log, and QueryRuntimeStatistics is a log table, not a metric.

  3. Question 38Interactive

    Review the following KQL query run against the CDBDataPlaneRequests table. What does the query identify?

    • AMost throttled partition rangeCorrect answer
    • BTotal Request Units consumed
    • CFastest queries by latency
    • DReplication lag between regions

    Why this is the answer

    The query filters for status code 429 and groups by PartitionKeyRangeId, so it surfaces the physical partition range responsible for the most throttled requests.

  4. Question 39Single Choice

    Which metric measures the maximum replication delay between a source region and a target region?

    • AReplicationLatencyCorrect answer
    • BServerSideLatency
    • CNormalizedRUConsumption
    • DTotalRequests

    Why this is the answer

    ReplicationLatency, also known as MaxReplicationLag, measures the maximum lag between a source and target region for multi-region accounts.

  5. Question 40Multiple Select

    Which two resource-specific diagnostic log tables should be enabled to analyze expensive queries and partition-level RU consumption?

    • ACDBDataPlaneRequestsCorrect answer
    • BCDBQueryRuntimeStatisticsCorrect answer
    • CCDBControlPlaneRequests
    • DCDBMetering

    Why this is the answer

    CDBDataPlaneRequests captures per-request RU charges, status codes, and partition range IDs; CDBQueryRuntimeStatistics exposes query text, index hit ratio, and retrieved document counts.

  6. Question 41Interactive

    Review the following indexing policy. What is the effect of this configuration?

    • AExcludes unqueried paths from the indexCorrect answer
    • BDisables indexing for the container
    • CAdds a composite index
    • DIndexes only string properties

    Why this is the answer

    The excludedPath removes /clientLogs/* from the index while the rest of the policy remains consistent, lowering write RU and storage for unqueried data.

  7. Question 42Single Choice

    Which dimension should be used to filter NormalizedRUConsumption when investigating a hot partition?

    • APartitionKeyRangeIdCorrect answer
    • BDatabaseName
    • CCollectionName
    • DOperationType

    Why this is the answer

    Filtering NormalizedRUConsumption by PartitionKeyRangeId reveals whether a single physical partition is near its throughput limit and causing a hotspot.

  8. Question 43Multiple Select

    Which two statements about Azure Cosmos DB reserved capacity are true?

    • AApplies to provisioned throughput in the selected regionCorrect answer
    • BCovers storage and backup costs
    • CCan be used with serverless accounts
    • DAvailable for one-year or three-year termsCorrect answer

    Why this is the answer

    Reserved capacity applies to the provisioned throughput meter in a specific region and is purchased for one or three years. Storage and serverless usage are not covered.

Frequently asked questions

Everything about the Microsoft Certified: Azure Cosmos DB Developer Specialty question bank and how to use it.