Microsoft DP-420 Practice Test Questions and Exam Dumps Part1 Q1-20

 

View Full Microsoft DP-420 Exam Dumps and Practice Test Dumps.


Q1. You are designing an Azure Cosmos DB for NoSQL container for an e-commerce application. Most queries retrieve orders for a specific customer, and each customer can have thousands of orders. Which partition key is the best starting choice?

  1. /customerId
  2. /orderDate
  3. /productName
  4. /status

Correct Answer: 1. /customerId

Explanation: A good partition key should align with common access patterns and distribute both data and request-unit consumption evenly. If most queries retrieve orders for a specific customer, using /customerId allows those queries to target a logical partition rather than fan out across many partitions. The key should also have sufficient cardinality to avoid hot partitions. Fields such as status often have too few distinct values, while order date can create uneven write patterns. Product name usually does not match the primary access pattern. Partition-key selection is one of the most important design decisions in Azure Cosmos DB.

Q2. Your application must retrieve one known item as efficiently as possible. You know both the item’s id and its partition key value. Which operation should you use?

  1. Cross-partition query
  2. Point read
  3. Change feed read
  4. Stored procedure

Correct Answer: 2. Point read

Explanation: A point read is the most efficient way to retrieve a single known item when both the item id and partition key value are available. Point reads have predictable low latency and typically consume fewer request units than equivalent SQL queries. A cross-partition query would scan or contact multiple partitions unnecessarily. The change feed is intended for processing changes over time, while stored procedures execute server-side transactional logic within a logical partition. When an application knows the exact identity and partition key of an item, a point operation should generally be preferred over a query.

Q3. You need to update only two properties of a large JSON document without replacing the entire item. Which Azure Cosmos DB SDK operation is most appropriate?

  1. Replace item
  2. Read item
  3. Patch item
  4. Delete item

Correct Answer: 3. Patch item

Explanation: Patch operations allow an application to modify selected properties of an item without sending a complete replacement document. This can be useful when only a small number of fields must change, such as status or quantity. Patch operations can reduce network payload and simplify update logic compared with replacing the entire item. A read operation does not modify data, while delete removes the item completely. Replace item remains appropriate when the whole document is being rewritten. Patch support is an important SDK capability for efficient partial updates in Azure Cosmos DB for NoSQL.

Q4. You need to execute multiple create and update operations atomically in Azure Cosmos DB for NoSQL. All items share the same partition key value. Which feature should you use?

  1. Bulk mode
  2. Transactional Batch
  3. Change feed processor
  4. Integrated cache

Correct Answer: 2. Transactional Batch

Explanation: Transactional Batch allows multiple operations against items with the same logical partition key to execute atomically. Either all operations succeed or the entire batch is rolled back. This is useful for workflows that require consistency across related items within one logical partition. Bulk mode improves throughput for large numbers of independent operations but does not provide one atomic transaction across them. Change feed processing reacts to changes after writes occur, while integrated cache reduces read latency and request-unit consumption. The same-partition requirement is essential because Azure Cosmos DB transactions are scoped to a logical partition.

Q5. Your application receives HTTP 429 responses from Azure Cosmos DB. What does this most commonly indicate?

  1. The item does not exist.
  2. Authentication failed.
  3. The provisioned request-unit capacity is being exceeded temporarily.
  4. The partition key is missing from the container definition.

Correct Answer: 3. The provisioned request-unit capacity is being exceeded temporarily.

Explanation: An HTTP 429 response indicates that requests are being rate-limited because the workload has temporarily exceeded the available request-unit throughput. Azure Cosmos DB SDKs generally include retry behavior and honor the server-provided retry interval. Frequent 429 responses may indicate a need to review throughput provisioning, query efficiency, partition distribution, or workload spikes. Missing items typically produce a 404 response, while authentication failures produce authorization-related errors. Monitoring normalized RU consumption and partition-level throughput can help identify whether throttling results from overall demand or an unevenly loaded logical or physical partition.

Q6. A globally distributed application requires reads to always return the most recent committed write, even if this increases latency. Which consistency level should you choose?

  1. Strong
  2. Eventual
  3. Consistent prefix
  4. Session

Correct Answer: 1. Strong

Explanation: Strong consistency guarantees that reads return the most recent committed version of an item. This provides the strictest consistency semantics but can have higher latency and availability tradeoffs in globally distributed scenarios. Eventual consistency offers lower consistency guarantees and may temporarily return older values. Consistent prefix guarantees ordering but not immediate visibility of the latest write. Session consistency provides strong read-your-writes behavior within a session and is often a practical default, but it does not provide the same global guarantee as strong consistency. Consistency selection should reflect the application’s correctness, availability, latency, and cost requirements.

Q7. You are designing a multi-region Azure Cosmos DB account. The application must continue accepting writes in multiple regions if one region becomes unavailable. What should you enable?

  1. Continuous backup only
  2. Multi-region writes
  3. Analytical store
  4. Serverless throughput

Correct Answer: 2. Multi-region writes

Explanation: Multi-region writes allow applications to write to more than one Azure region, which can improve write availability and reduce write latency for globally distributed users. If a region becomes unavailable, other writable regions can continue accepting writes. Conflict resolution must be considered because concurrent updates can occur in different regions. Continuous backup provides recovery capabilities but does not make multiple regions writable. Analytical store supports analytical workloads, while serverless changes the throughput billing model. Multi-region write configuration is a key design choice for applications that require globally distributed write availability.

Q8. You need to process every change made to items in a container and use those changes to maintain a denormalized projection in another container. Which feature should you use?

  1. Change feed
  2. Integrated cache
  3. Point reads
  4. Composite indexes

Correct Answer: 1. Change feed

Explanation: The Azure Cosmos DB change feed provides an ordered record of changes to items and is commonly used to implement event-driven processing, denormalization, aggregation, archiving, and integration with other Azure services. An Azure Function trigger or SDK-based change feed processor can consume changes and update a projection in another container. Integrated cache accelerates eligible reads, point reads retrieve known items, and composite indexes optimize certain ordered queries. Change feed patterns are especially useful in non-relational systems where denormalized data must be updated asynchronously as source documents change.

Q9. You want a document to expire automatically 24 hours after it is created unless a different expiration is specified at the item level. What should you configure?

  1. A composite index
  2. A unique key
  3. Default time to live on the container
  4. Continuous backup

Correct Answer: 3. Default time to live on the container

Explanation: Time to live, or TTL, allows Azure Cosmos DB to automatically remove items after a specified number of seconds. Configuring a default TTL on the container provides a standard expiration period for items, while individual items can override the default when required. This is useful for transient data such as sessions, events, caches, or temporary workflow information. Unique keys enforce uniqueness, composite indexes support specific query patterns, and continuous backup provides restore capabilities. TTL helps automate lifecycle management without requiring the application to explicitly delete expired documents.

Q10. You are creating an Azure Cosmos DB client in a high-throughput web application. Which client-management practice is recommended?

  1. Create a new client for every request.
  2. Maintain a singleton client instance.
  3. Recreate the client after every query.
  4. Create one client per document.

Correct Answer: 2. Maintain a singleton client instance.

Explanation: Azure Cosmos DB client objects are designed to be long-lived and reused. Maintaining a singleton client allows connection resources, caches, and internal networking components to be reused efficiently. Creating a new client for every request can increase connection overhead, resource usage, and latency, potentially leading to port exhaustion or poor throughput. Applications should generally initialize the client once and reuse it throughout the application’s lifetime. Connectivity mode, preferred regions, retry behavior, and SDK logging can then be configured centrally. Efficient client lifecycle management is an important part of Azure Cosmos DB application performance.

Q11. A query frequently filters by category and orders results by createdDate. The query currently has high request-unit cost. Which indexing feature may improve this pattern?

  1. Spatial index only
  2. Unique key
  3. Composite index
  4. TTL policy

Correct Answer: 3. Composite index

Explanation: Composite indexes are useful for queries that combine filters and ordering across multiple properties or require ordering on multiple fields. If a common query filters by one property and orders by another, an appropriate composite index can reduce query work and request-unit consumption. Unique keys enforce uniqueness constraints but do not optimize this query pattern. TTL controls item expiration, while spatial indexes are intended for geographic data types and spatial queries. Indexing should be designed around actual access patterns, and query metrics should be reviewed to verify whether the chosen index improves performance.

Q12. You need to ensure that no two items in the same logical partition can have the same value for an emailAddress property. What should you configure when creating the container?

  1. Unique key policy
  2. Session token
  3. Analytical store
  4. Change feed estimator

Correct Answer: 1. Unique key policy

Explanation: A unique key policy enforces uniqueness for specified properties within a logical partition. If emailAddress is included in the unique key policy, Azure Cosmos DB prevents multiple items in the same logical partition from using the same email value. Unique key policies must be planned when the container is created and cannot simply be added later without recreating the container. Session tokens support session consistency, analytical store supports analytical workloads, and the change feed estimator helps monitor change feed processor lag. Unique keys are part of schema and data-integrity design.

Q13. Your workload performs millions of independent item writes and you want the SDK to maximize throughput by executing operations concurrently. Which feature should you enable?

  1. Strong consistency
  2. Bulk support
  3. Stored procedures
  4. Point-in-time restore

Correct Answer: 2. Bulk support

Explanation: Bulk support in the Azure Cosmos DB SDK is intended for high-throughput scenarios involving many independent create, update, or delete operations. It allows the SDK to schedule and execute operations concurrently and efficiently across partitions. Bulk support does not provide a single atomic transaction across all operations. Transactional Batch is required when atomicity is needed for multiple operations within the same logical partition. Strong consistency affects read semantics, stored procedures execute server-side JavaScript within a partition, and point-in-time restore concerns recovery. Bulk mode is appropriate for large-scale ingestion or migration workloads.

Q14. An application updates items that may also be modified by other application instances. You want to reject an update if the item has changed since it was last read. Which mechanism should you use?

  1. TTL
  2. ETag-based optimistic concurrency control
  3. Change feed estimator
  4. Database-level throughput

Correct Answer: 2. ETag-based optimistic concurrency control

Explanation: Each Azure Cosmos DB item has an ETag that changes when the item is modified. An application can read the item and then submit an update with a conditional request based on the previously retrieved ETag. If another process changed the item in the meantime, the condition fails and the application can handle the conflict appropriately. This implements optimistic concurrency without locking. TTL controls expiration, change feed estimator reports change processing progress, and database-level throughput governs request-unit allocation. ETag conditions are the correct mechanism for detecting concurrent modifications.

Q15. A query returns thousands of items, but your application should process the results in manageable pages and resume later if necessary. What should you use?

  1. Continuation tokens
  2. Unique keys
  3. Manual failover
  4. Spatial indexes

Correct Answer: 1. Continuation tokens

Explanation: Continuation tokens allow an application to resume a paged Azure Cosmos DB query from where the previous page ended. The SDK can return a page of results together with a token that can be supplied to a later request to continue processing. This is useful for large result sets, APIs with page-based responses, and workloads that cannot process all matching items at once. Unique keys enforce constraints, manual failover changes region roles, and spatial indexes optimize geospatial queries. Pagination and continuation-token handling are fundamental SDK query patterns.

Q16. You want to develop and test an Azure Cosmos DB for NoSQL application locally without connecting to an Azure account. Which tool should you use?

  1. Azure Monitor
  2. Microsoft Fabric
  3. Azure Cosmos DB emulator
  4. Azure Event Hubs

Correct Answer: 3. Azure Cosmos DB emulator

Explanation: The Azure Cosmos DB emulator provides a local environment for developing and testing applications that use Azure Cosmos DB capabilities without requiring a live Azure Cosmos DB account. It is useful for local development, automated testing, and learning SDK behavior. Azure Monitor is used for observability and metrics, Microsoft Fabric provides broader analytics capabilities, and Event Hubs supports event ingestion. While developers should still validate production-specific behaviors in Azure, the emulator can reduce development cost and simplify testing of common Azure Cosmos DB application scenarios.

Q17. You need to monitor whether request-unit consumption is approaching the maximum available throughput for a container. Which Azure Monitor metric is especially useful?

  1. Document count only
  2. Normalized RU Consumption
  3. Backup size only
  4. Session-token count

Correct Answer: 2. Normalized RU Consumption

Explanation: Normalized RU Consumption shows request-unit usage relative to the available throughput and helps identify whether a workload is approaching saturation. High normalized RU consumption can lead to throttling and HTTP 429 responses. Monitoring this metric alongside partition-level usage, latency, failures, and data distribution can help diagnose capacity or hot-partition problems. Document count alone does not indicate throughput pressure, backup size is unrelated to request processing, and session-token count is not the metric used for RU saturation. Azure Monitor metrics are important for ongoing performance and reliability management.

Q18. Your organization requires the ability to restore Azure Cosmos DB data to a specific point within the supported retention window after accidental deletion. Which backup option should you choose?

  1. Periodic backup only
  2. Continuous backup with point-in-time restore
  3. Change feed only
  4. Serverless mode

Correct Answer: 2. Continuous backup with point-in-time restore

Explanation: Continuous backup supports point-in-time restore, allowing data to be recovered to a selected point within the available retention window. This is useful for recovering from accidental deletions or application-level corruption. Periodic backup creates backups according to a schedule but does not provide the same fine-grained point-in-time recovery experience. Change feed records changes for processing but is not a substitute for a managed backup and restore strategy. Serverless mode controls billing and throughput behavior rather than recovery. Backup design should align with recovery-point and recovery-time requirements.

Q19. You need to execute logic on the server that performs multiple operations transactionally within one logical partition. Which Azure Cosmos DB server-side object can support this?

  1. Stored procedure
  2. Integrated cache
  3. Composite index
  4. Azure Monitor alert

Correct Answer: 1. Stored procedure

Explanation: Stored procedures in Azure Cosmos DB for NoSQL are written in JavaScript and execute within the scope of a single logical partition. Operations performed within the stored procedure can participate in a transaction, making stored procedures useful when server-side transactional logic is required. They do not span multiple logical partitions. Integrated cache improves eligible read performance, composite indexes optimize query execution, and Azure Monitor alerts provide operational notifications. Server-side programming can be useful for specialized scenarios, although many application workflows can also be implemented through SDK Transactional Batch operations.

Q20. You need to analyze Azure Cosmos DB data with analytical tools while reducing the performance impact on the transactional workload. Which capability should you enable on the container?

  1. Unique key policy
  2. Analytical store
  3. Strong consistency
  4. Manual failover

Correct Answer: 2. Analytical store

Explanation: Analytical store provides a column-oriented representation of Azure Cosmos DB data designed for large-scale analytical queries without placing the same level of demand on the transactional workload. It can be used with supported analytics services such as Azure Synapse workloads and is part of architectures that separate operational and analytical access patterns. Unique keys enforce data integrity, strong consistency changes read guarantees, and manual failover changes regional write configuration. Analytical store is appropriate when operational data must also support analytics without relying entirely on expensive queries against the transactional store.