View Full Microsoft DP-420 Exam Dumps and Practice Test Dumps.
Q1. You are designing an Azure Cosmos DB container for a ticketing system. Most queries retrieve tickets by organization and then filter by ticket type. Some organizations generate very large volumes. Which design should you consider?
- Use /status as the only partition key.
- Store all tickets in one logical partition.
- Use /ticketType as the only partition key.
- Use a hierarchical partition key beginning with /organizationId and followed by another high-cardinality property.
Correct Answer: 4. Use a hierarchical partition key beginning with /organizationId and followed by another high-cardinality property.
Explanation: A hierarchical partition key can preserve efficient organization-based access while allowing data for very large organizations to be distributed further using another high-cardinality property. This can help prevent a single large tenant from reaching logical-partition limits or becoming a throughput hotspot. A low-cardinality field such as status or ticket type may concentrate activity into only a few values. Placing all tickets in one logical partition would severely limit scalability. Partition-key design should reflect both dominant query patterns and expected storage and request-unit distribution as the workload grows.
Q2. You are using a Cosmos DB SDK and want to retrieve several pages of query results while limiting the number of items returned per page. Which setting should you configure?
- Item TTL.
- Query request options such as maximum item count.
- Unique key policy.
- Regional failover priority.
Correct Answer: 2. Query request options such as maximum item count.
Explanation: Query request options can influence pagination behavior, including the maximum number of items the SDK attempts to return in each page. Continuation tokens can then be used to retrieve subsequent pages. This is useful when an application wants controlled response sizes or needs to process large result sets incrementally. TTL governs item expiration, unique keys enforce data constraints, and failover priority controls regional behavior. Page size settings should be chosen with application response-time, memory, request-unit consumption, and user-experience requirements in mind rather than simply requesting the largest possible page.
Q3. You need to update a document only when its current version still matches the version previously read by the application. Which mechanism should you use?
- ETag-based optimistic concurrency.
- TTL expiration.
- Change feed processing.
- Analytical store.
Correct Answer: 1. ETag-based optimistic concurrency.
Explanation: Each Cosmos DB item has an ETag that changes when the item is modified. The application can read an item, retain the ETag, and then issue an update using a conditional If-Match request. If another process has changed the item, the ETag no longer matches and the update is rejected. This supports optimistic concurrency without locking the item. TTL handles expiration, change feed is used to process changes asynchronously, and analytical store supports analytical workloads. ETag-based conditions are especially useful in applications where multiple clients may update the same document concurrently.
Q4. You need one Azure Cosmos DB account to support users located in Europe, Asia, and North America with low read latency. Which capability should you use?
- One write region only with no replicas.
- One logical partition for all data.
- Add replicated Azure regions close to the users.
- Disable indexing.
Correct Answer: 3. Add replicated Azure regions close to the users.
Explanation: Azure Cosmos DB supports global distribution by replicating data across Azure regions. Adding regions near major user populations can reduce network latency for reads and improve availability. The SDK can also be configured with preferred regions so applications prioritize nearby replicas. Replication design should account for consistency level, failover strategy, write topology, data residency, and cost. A single region forces geographically distant users to traverse longer network paths. Logical partitioning and indexing are separate concerns and do not replace geographically distributed replication.
Q5. A container contains millions of events. Most events expire naturally after seven days, but a small subset must remain indefinitely. Which TTL design is appropriate?
- Configure a default container TTL and override TTL for items that must not expire.
- Disable TTL and run a full container scan every hour.
- Create a new Cosmos DB account every seven days.
- Use a composite index to delete old items.
Correct Answer: 1. Configure a default container TTL and override TTL for items that must not expire.
Explanation: Container-level TTL can establish a default expiration period for most items, while individual documents can override that behavior when a different lifecycle is required. This is well suited to event workloads where most records are temporary but selected records must be retained. TTL allows Cosmos DB to manage expiration without application cleanup jobs. Composite indexes affect query optimization and do not perform deletion. Repeated scans would consume unnecessary request units, and creating new accounts does not solve lifecycle management. TTL design should match the retention requirements of each item category.
Q6. Your application performs a very large number of independent writes across many partition keys. No cross-item transaction is required. Which SDK capability should you enable?
- Strong consistency.
- Stored procedure execution for every item.
- Integrated cache.
- Bulk execution support.
Correct Answer: 4. Bulk execution support.
Explanation: Bulk execution is designed for workloads that perform many independent operations and want the SDK to schedule and execute them efficiently in parallel. It is useful for migrations, ingestion jobs, or large update processes where each operation can succeed independently. Bulk mode does not provide one atomic transaction across all writes. If atomicity is required for operations within one logical partition, Transactional Batch is more appropriate. Strong consistency affects reads, stored procedures are server-side transactional code scoped to one logical partition, and integrated cache improves read performance rather than write throughput.
Q7. You need a query to return documents where a nested array contains at least one value matching a condition, but you do not need to flatten all array elements into separate result rows. Which SQL technique is most appropriate?
- TTL.
- A unique key policy.
- An array-aware subquery or array function.
- Manual failover.
Correct Answer: 3. An array-aware subquery or array function.
Explanation: Cosmos DB SQL supports functions and subquery patterns that can evaluate arrays without necessarily returning one row per array element. This can be useful when the goal is simply to determine whether any nested value meets a condition. A JOIN is often used when array elements need to be flattened into separate rows, while array-aware predicates can be more natural for existence checks. TTL, unique keys, and failover are unrelated to nested-array querying. Understanding JSON-aware query patterns helps reduce unnecessary application-side processing and improves clarity of document queries.
Q8. You want an application to read from the closest healthy Azure Cosmos DB region automatically based on an ordered preference list. What should you configure in the SDK?
- Default TTL.
- Preferred regions.
- Unique keys.
- Composite indexes.
Correct Answer: 2. Preferred regions.
Explanation: Preferred-region configuration tells the Cosmos DB SDK which regions should be prioritized for requests. In a globally distributed account, this can help applications use geographically close replicas for lower latency while allowing fallback to another healthy configured region when necessary. TTL, unique keys, and composite indexes affect document lifecycle, integrity, and query performance rather than regional routing. The preference list should correspond to the deployment locations of application instances and should be tested together with the account’s failover and consistency configuration.
Q9. A query frequently filters by tenantId and performs ORDER BY createdAt DESC. Which change can reduce query cost when the existing indexing policy is not optimal for the pattern?
- Enable TTL.
- Remove the partition key.
- Switch to Eventual consistency.
- Add an appropriate composite index.
Correct Answer: 4. Add an appropriate composite index.
Explanation: Composite indexes can improve Cosmos DB query patterns that combine filters with ordered results across multiple properties. An index matching the query’s relevant paths and sort directions can reduce request-unit consumption and improve execution behavior. TTL affects document expiration, consistency level changes read semantics, and the partition key cannot simply be removed from a scalable partitioned container. Composite indexes add write and storage overhead, so they should be created based on important, repeated access patterns and validated by examining query metrics and request charges before and after the change.
Q10. You are implementing a custom change feed consumer and want explicit control over when each page of changes is requested and how checkpoints are stored. Which approach should you use?
- Change feed pull model.
- Integrated cache.
- Analytical store.
- Unique key policy.
Correct Answer: 1. Change feed pull model.
Explanation: The change feed pull model allows application code to explicitly request pages from the change feed and control how processing state is handled. It can be appropriate for custom processing frameworks that require their own scheduling, partition assignment, or checkpoint strategy. The change feed processor is easier for standard scalable scenarios because it manages leases and load balancing automatically. Integrated cache accelerates reads, analytical store serves analytical workloads, and unique keys enforce constraints. The pull model offers flexibility, but the application assumes more responsibility for reliable processing and state management.
Q11. A change feed processor has four application instances. You want to know whether incoming changes are accumulating faster than the instances can process them. Which component should you use?
- Unique key monitor.
- TTL calculator.
- Change feed estimator.
- Spatial index.
Correct Answer: 3. Change feed estimator.
Explanation: The change feed estimator can report an estimate of pending work for a change feed processor. This allows operators to determine whether processors are keeping up with incoming changes and whether additional instances or throughput may be required. It is especially useful for downstream workflows that must remain close to real time. Unique keys and TTL do not measure processing backlog, while spatial indexes support geographic queries. Monitoring lag is important because an apparently healthy processor can still be falling progressively behind if the write rate consistently exceeds processing capacity.
Q12. You need a server-side JavaScript function that can be invoked from a Cosmos DB SQL query to perform a custom scalar calculation. Which object should you create?
- Stored procedure.
- User-defined function.
- Post-trigger.
- Change feed processor.
Correct Answer: 2. User-defined function.
Explanation: A user-defined function, or UDF, is server-side JavaScript that can be called from Cosmos DB SQL queries and returns a calculated value. Stored procedures are used for server-side transactional operations within one logical partition, while triggers execute before or after specified item operations when explicitly invoked. Change feed processors run in application code and consume data changes asynchronously. Built-in SQL functions are generally preferable when they can satisfy the requirement because they are optimized by the service, but a UDF can handle specialized logic that has no suitable built-in equivalent.
Q13. Your organization needs Cosmos DB operational data to be available in Microsoft Fabric without building a traditional ETL pipeline. Which feature should you evaluate?
- Azure Cosmos DB Mirroring for Microsoft Fabric.
- Manual CSV export.
- Stored procedure replication.
- Session-token forwarding.
Correct Answer: 1. Azure Cosmos DB Mirroring for Microsoft Fabric.
Explanation: Azure Cosmos DB Mirroring for Microsoft Fabric is designed to make operational Cosmos DB data available for analytical workloads in Fabric with reduced custom data-movement engineering. It can be a better fit than manually maintaining ETL pipelines when the goal is managed replication into the Fabric analytics ecosystem. Manual exports introduce operational overhead, stored procedures are transactional server-side code, and session tokens concern consistency. Mirroring should be compared with Spark-based integration depending on whether the workload needs managed analytical replication or direct programmatic read/write processing through Spark.
Q14. A Spark job needs to query the Cosmos DB transactional store directly rather than the analytical store. What should you use?
- A TTL policy.
- Azure Cosmos DB Spark connector.
- Azure Monitor alerts.
- Manual failover.
Correct Answer: 2. Azure Cosmos DB Spark connector.
Explanation: The Azure Cosmos DB Spark connector enables Spark workloads to interact with the transactional store for supported reads and writes. This is appropriate when Spark processing needs operational data directly rather than using the analytical store. TTL manages item lifecycle, Azure Monitor alerts provide operational notifications, and manual failover changes regional write roles. Spark jobs should be designed carefully because direct transactional-store access consumes request units and can compete with production application traffic if throughput and concurrency are not planned appropriately.
Q15. You want to build a full-text search experience over product descriptions stored in Cosmos DB. Which Azure service should you integrate?
- Azure Monitor.
- Azure Backup.
- Azure Bastion.
- Azure AI Search.
Correct Answer: 4. Azure AI Search.
Explanation: Azure AI Search provides dedicated search-engine capabilities, including text indexing and relevance-oriented search experiences, that go beyond standard database filtering. Cosmos DB can remain the operational data source while Azure AI Search maintains a separate search index for user-facing search features. Azure Monitor provides observability, Azure Backup is unrelated to search, and Azure Bastion provides virtual-machine access. Specialized search workloads are often best handled by a dedicated search service rather than forcing the operational database to behave like a full-text search engine.
Q16. Your monitoring dashboard shows high total RU/s usage. You want to determine whether the load is evenly spread or concentrated on a small number of partitions. What should you inspect?
- The backup interval only.
- The account name.
- Throughput consumption across partitions.
- Only the number of containers.
Correct Answer: 3. Throughput consumption across partitions.
Explanation: Partition-level throughput metrics help reveal whether request-unit usage is balanced or whether one partition is disproportionately busy. A hot partition can cause throttling even when account-level utilization appears acceptable. This often indicates skewed partition-key values or workload patterns. Backup intervals and account names provide no useful insight into request distribution. Monitoring both throughput and data distribution across partitions is essential for validating the effectiveness of a partition-key strategy in production, especially as tenant populations, data volume, and access patterns evolve.
Q17. You need to restore a Cosmos DB resource to its state immediately before a destructive application deployment. The account uses continuous backup. What should you locate?
- A valid point-in-time restore point before the deployment.
- A continuation token.
- An ETag for every item.
- A change feed lease.
Correct Answer: 1. A valid point-in-time restore point before the deployment.
Explanation: Continuous backup allows supported point-in-time restore within the configured retention window. To recover from a destructive deployment, administrators need to identify a point just before the unwanted changes began. Selecting the correct restore point helps minimize loss of valid data while excluding corrupted or deleted records. Continuation tokens support query paging, ETags support concurrency, and change feed leases track processor progress. Restore procedures should be documented and tested so teams can quickly identify timestamps, affected resources, and validation steps during an actual incident.
Q18. You need an alert whenever HTTP 429 throttling persists above an acceptable threshold for five minutes. Which Azure feature should you configure?
- Unique key policy.
- Azure Monitor alert rule.
- Analytical store.
- Transactional Batch.
Correct Answer: 2. Azure Monitor alert rule.
Explanation: Azure Monitor alert rules can evaluate Cosmos DB metrics and trigger notifications or automation when configured conditions remain true. An alert on sustained throttling can warn operators that available throughput is insufficient or that a hot partition may exist. Action groups can route alerts to email, SMS, webhook endpoints, or automation systems. Unique keys, analytical store, and Transactional Batch do not provide operational notifications. Effective monitoring should include alerts for throttling, latency, failures, and other conditions that indicate degradation before users report an outage.
Q19. You need detailed historical request information for security investigation and Kusto-based analysis. What should you configure?
- Integrated cache only.
- TTL history.
- Azure Monitor resource logs routed to Log Analytics.
- A stored procedure.
Correct Answer: 3. Azure Monitor resource logs routed to Log Analytics.
Explanation: Azure Monitor diagnostic settings can send Cosmos DB resource logs to a Log Analytics workspace, where teams can query the logs with Kusto Query Language. This supports auditing, incident investigation, security monitoring, and correlation with application or network telemetry. Integrated cache improves read performance, TTL does not provide request history, and stored procedures execute application logic rather than maintain operational audit data. Centralized logs are particularly valuable when organizations need to investigate unusual access patterns or reconstruct the sequence of events surrounding failures.
Q20. A business can tolerate stale reads but requires that updates always appear in the same order in which they were written. Which consistency level should you consider?
- Strong.
- Session.
- Bounded staleness.
- Consistent prefix.
Correct Answer: 4. Consistent prefix.
Explanation: Consistent prefix guarantees that reads never observe writes out of order. A reader may see an older prefix of the write sequence, but it will not see later writes without earlier ones. This can be appropriate when temporary staleness is acceptable but ordering must remain correct. Eventual consistency offers weaker ordering guarantees, while session consistency provides stronger session-scoped behavior. Bounded staleness limits how far reads can lag, and strong consistency provides the strictest semantics. The correct consistency level should match the application’s actual correctness needs rather than automatically selecting the strongest option.