Microsoft DP-420 Practice Test Questions and Exam Dumps Part16 Q301-320

 

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


Q1. You are designing an Azure Cosmos DB for NoSQL application that stores customer preferences. The application usually retrieves a complete customer’s preference profile in one operation. Which modeling approach is generally most appropriate when the data remains reasonably small?

  1. Store every preference property in a different database.
  2. Embed the related preferences in the customer document.
  3. Store each preference under a random partition key.
  4. Create a separate Azure subscription for every customer.

Correct Answer: 2. Embed the related preferences in the customer document.

Explanation: Embedding related data in a single document is often appropriate when the information is typically read and updated together and shares the same lifecycle. Customer preferences usually fit this pattern because retrieving one document can provide the complete preference profile without additional reads. This can reduce latency and request-unit consumption compared with resolving many separate documents. Separate storage can still be appropriate when related data becomes very large, is shared among many entities, or changes independently. Azure Cosmos DB modeling should prioritize dominant access patterns and transactional boundaries rather than traditional relational normalization rules.

Q2. You are creating a multi-tenant Cosmos DB application. Queries almost always include tenantId, but several very large tenants require additional distribution. What should you consider?

  1. Hierarchical partition keys.
  2. A constant partition key.
  3. Disabling partitioning.
  4. Using a Boolean field as the partition key.

Correct Answer: 1. Hierarchical partition keys.

Explanation: Hierarchical partition keys are useful when a first-level property aligns well with the access pattern but some values at that level can become extremely large. Using tenantId as the first level and another high-cardinality property as a lower level can preserve tenant-oriented routing while allowing very large tenants to distribute data further. A constant or Boolean partition key has low cardinality and can cause severe hot-partition problems. Scalable Cosmos DB containers rely on partitioning, so removing the partition key is not an appropriate solution.

Q3. An application must update three items atomically. All three items share the same partition key value. Which Cosmos DB SDK feature should you use?

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

Correct Answer: 3. Transactional Batch.

Explanation: Transactional Batch allows multiple item operations with the same logical partition key to be grouped into one atomic transaction. If any operation fails, the entire batch fails, preventing partial updates. Bulk execution is designed for throughput and does not provide one atomic transaction across all operations. Change feed processing occurs asynchronously after writes have been committed, and integrated cache is used to optimize eligible reads. Because Cosmos DB transactional scope is limited to a logical partition, partition-key design directly influences which multi-item operations can participate in the same transaction.

Q4. A large document contains 40 properties, but you need to change only the priority property. Which operation should you use?

  1. Delete and recreate the item.
  2. Replace the entire item.
  3. Run a cross-partition query.
  4. Patch the item.

Correct Answer: 4. Patch the item.

Explanation: Patch operations allow an application to modify selected document properties without sending the full item back to Cosmos DB. This is useful when only one or a few values need to change and can reduce payload size and simplify client logic. Replacing the full item is still valid in many scenarios, but it is unnecessary when only a small property update is required. Delete-and-create adds unnecessary operations, while queries retrieve data rather than provide the targeted update behavior. Patch can also support operations such as increment, add, replace, and remove.

Q5. Your application knows the id and partition key for one document. Which operation should you prefer for the lowest-cost lookup?

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

Correct Answer: 1. Point read.

Explanation: A point read directly addresses an item by using its id and partition-key value. This avoids the SQL query engine and is generally one of the lowest-latency and lowest-RU read operations in Azure Cosmos DB. A query can retrieve the same document, but it usually consumes more resources because query processing is involved. Stored procedures are unnecessary for a simple item lookup, and the change feed is intended for processing changes over time. Applications should preserve both item IDs and partition-key values when frequent direct reads are expected.

Q6. You need the application to reject an item replacement when the item has changed since it was originally read. What should you use?

  1. TTL.
  2. A continuation token.
  3. An ETag with an If-Match condition.
  4. A unique key policy.

Correct Answer: 3. An ETag with an If-Match condition.

Explanation: Each Cosmos DB item has an ETag that changes when the item is modified. An application can retain the ETag from the initial read and include it in a conditional update. If another process changed the item, the ETag will no longer match and the update is rejected. This implements optimistic concurrency control without holding locks. TTL controls expiration, continuation tokens manage query pagination, and unique key policies enforce uniqueness constraints. ETag-based concurrency is particularly useful when multiple users or services may update the same document concurrently.

Q7. Your application requires read-your-writes behavior for each user’s session but does not require globally strong consistency. Which consistency level should you consider?

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

Correct Answer: 2. Session.

Explanation: Session consistency provides read-your-writes and monotonic-read guarantees within a session while typically offering better latency and availability characteristics than Strong consistency. It is a common choice for interactive applications where users expect to immediately see their own updates. Eventual consistency allows stale reads, while Consistent Prefix guarantees ordering but not immediate visibility of the latest write. Strong consistency provides the strictest guarantees but can introduce different tradeoffs. Session tokens can also be propagated between application instances when requests for the same user session are load-balanced across servers.

Q8. You need reads to lag behind writes by no more than a defined time interval. Which consistency level is designed for this requirement?

  1. Session.
  2. Eventual.
  3. Consistent prefix.
  4. Bounded staleness.

Correct Answer: 4. Bounded staleness.

Explanation: Bounded staleness allows applications to specify the maximum acceptable lag between reads and writes using either a time interval or a number of versions. It provides stronger guarantees than Eventual or Consistent Prefix consistency while offering more flexibility than Strong consistency. Session consistency provides user-session guarantees but does not define the same global staleness bound. Bounded staleness is suitable when slightly stale data is acceptable but the business requires a firm upper limit on how old returned data can be.

Q9. You need a SQL query to return only documents where an optional configuration property exists. Which query function should you use?

  1. IS_DEFINED
  2. ABS
  3. ARRAY_LENGTH
  4. VectorDistance

Correct Answer: 1. IS_DEFINED

Explanation: IS_DEFINED tests whether a JSON property exists in a document. This is useful in flexible-schema containers where some items may omit optional fields entirely. A missing property is different from one explicitly set to null, so queries should use the correct type or existence-checking function depending on the requirement. ABS is mathematical, ARRAY_LENGTH operates on arrays, and VectorDistance is used for similarity search on embeddings. Schema-flexible queries are an important Cosmos DB skill because documents in one container can have different structures.

Q10. A document contains an array of tags. You need to determine whether the array includes “priority”. Which SQL function is most appropriate?

  1. DateTimeDiff
  2. IS_NUMBER
  3. ARRAY_CONTAINS
  4. CONCAT

Correct Answer: 3. ARRAY_CONTAINS

Explanation: ARRAY_CONTAINS checks whether a JSON array contains a specified value or matching object, depending on the parameters used. It is useful when you need an existence test without flattening the array into separate result rows. A JOIN is more appropriate if individual array elements need to become separate rows. DateTimeDiff works with dates, IS_NUMBER tests JSON value types, and CONCAT manipulates text. Native array functions make it easier to query the nested document structures commonly used in Cosmos DB.

Q11. You need a query to return documents ordered first by region and then by createdAt. Which index should you evaluate?

  1. Spatial index.
  2. Composite index.
  3. Full-text index.
  4. Vector index.

Correct Answer: 2. Composite index.

Explanation: Composite indexes are designed to support certain query patterns that involve multiple scalar properties, especially multi-property ORDER BY clauses and some combinations of equality and range predicates. The index paths and sort directions should align with the query. Spatial indexes support geographic data, full-text indexes support textual search, and vector indexes support similarity search over embeddings. Composite indexes increase index-maintenance overhead on writes, so they should be created for important recurring query patterns and validated by comparing request charges before and after the change.

Q12. A container stores embedding vectors that will be used for semantic similarity search. Which feature should you configure?

  1. A vector embedding policy and vector index.
  2. TTL only.
  3. A unique key only.
  4. A spatial index.

Correct Answer: 1. A vector embedding policy and vector index.

Explanation: Vector search in Azure Cosmos DB requires configuration that identifies the embedding path and describes properties such as vector dimensions, data type, and distance function. A vector index then improves similarity-search performance over that property. This supports scenarios such as recommendations, semantic retrieval, and retrieval-augmented generation. TTL controls document retention, unique keys enforce constraints, and spatial indexes optimize geographic workloads. The vector configuration must match the embeddings generated by the application, including compatible dimensions and distance semantics.

Q13. You need native keyword search over a content property with language-aware text processing. Which feature should you configure?

  1. Analytical store.
  2. A full-text policy and full-text index.
  3. Change feed processor.
  4. Transactional Batch.

Correct Answer: 2. A full-text policy and full-text index.

Explanation: Native full-text search relies on a full-text policy that identifies searchable text paths and associated language behavior, together with a full-text index that optimizes search operations. This allows Cosmos DB to support language-aware search behavior instead of simple scalar string comparisons alone. Analytical store is intended for analytics, change feed processor handles item changes, and Transactional Batch performs atomic writes. Full-text search can be combined with vector search in hybrid retrieval scenarios where both semantic similarity and lexical relevance are important.

Q14. You need to asynchronously maintain a denormalized reporting document whenever source records change. Which feature should you use?

  1. Integrated cache.
  2. TTL.
  3. Change feed.
  4. Strong consistency.

Correct Answer: 3. Change feed.

Explanation: The change feed provides an ordered stream of item changes that can drive asynchronous downstream processing. A change feed processor or Azure Function can consume source changes and update a denormalized reporting document or projection. This keeps the original transactional write path fast while allowing reporting structures to be optimized independently. Integrated cache is not durable storage, TTL manages expiration, and Strong consistency affects reads. Change feed-driven denormalization is a common pattern in Cosmos DB because it supports multiple optimized views of the same underlying business information.

Q15. Multiple change feed processor instances are running. Which resource is used to coordinate ownership and checkpoints?

  1. Lease container.
  2. Analytical store.
  3. Unique key policy.
  4. Integrated cache.

Correct Answer: 1. Lease container.

Explanation: The change feed processor uses a lease container to coordinate ownership of feed ranges, persist processing progress, and support load balancing among worker instances. As processors are added or removed, lease ownership can move so work remains distributed. If the lease container becomes unavailable, checkpointing and coordination are directly affected. Analytical store supports analytics, unique keys enforce data constraints, and integrated cache accelerates eligible reads. The lease container is therefore an operational dependency of scalable change feed processing.

Q16. You need to detect whether a change feed processor is accumulating backlog. Which capability should you use?

  1. TTL.
  2. Change feed estimator.
  3. Composite indexing.
  4. Backup history.

Correct Answer: 2. Change feed estimator.

Explanation: The change feed estimator provides an estimate of pending changes that have not yet been processed. This helps operators determine whether processor instances are keeping up with the rate of source changes. A growing backlog can indicate that more processor capacity or more throughput is required. TTL, indexing, and backup history do not provide change-processing lag information. Monitoring backlog is especially important for workloads where downstream materialized views, integrations, or business workflows need to remain close to real time.

Q17. You want to run broad analytical scans over Cosmos DB data while minimizing impact on transactional RU consumption. Which capability should you use?

  1. Multi-region writes.
  2. Integrated cache.
  3. Analytical store.
  4. Transactional Batch.

Correct Answer: 3. Analytical store.

Explanation: Analytical store provides a column-oriented representation of Cosmos DB data designed for analytical workloads. It helps isolate analytical scans from the request-unit consumption of the transactional store, making it more suitable for large reporting, data-science, or Spark workloads. Integrated cache helps repeated operational reads but is not designed for full analytical scans. Multi-region writes address global availability, and Transactional Batch provides atomic same-partition writes. Choosing analytical store helps prevent analytical workloads from competing directly with latency-sensitive operational traffic.

Q18. You want Cosmos DB data available in Microsoft Fabric without building and maintaining a traditional ETL pipeline. Which feature should you evaluate?

  1. Cosmos DB Mirroring for Microsoft Fabric.
  2. A SQL UDF.
  3. Manual failover.
  4. TTL.

Correct Answer: 1. Cosmos DB Mirroring for Microsoft Fabric.

Explanation: Cosmos DB Mirroring for Microsoft Fabric provides a managed method to make operational Cosmos DB data available to Fabric analytical workloads. This can reduce the need to build and operate custom ETL pipelines solely for replication. It is useful when organizations want a more integrated operational-to-analytics experience. A SQL UDF extends query logic, manual failover changes regional write roles, and TTL controls retention. Mirroring should be compared with Spark connectors or other integrations depending on whether the workload needs managed replication or direct transactional-store processing.

Q19. You need to restore data to a precise point before a faulty application release. Which backup configuration supports this?

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

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

Explanation: Continuous backup allows supported Cosmos DB resources to be restored to a selected point within the available retention window. This is useful for recovering from accidental deletion, application bugs, or logical corruption introduced by a deployment. Periodic backup provides scheduled recovery points but not the same granular point-in-time capability. Change feed and integrated cache are not substitutes for managed backup. Recovery procedures should identify the correct restore timestamp, affected scope, validation steps, and how applications will be redirected after restoration.

Q20. You want an automated notification when HTTP 429 throttling remains elevated for several minutes. Which Azure capability should you configure?

  1. Unique key policy.
  2. Azure Monitor alert rule with an action group.
  3. TTL.
  4. A stored procedure.

Correct Answer: 2. Azure Monitor alert rule with an action group.

Explanation: Azure Monitor alert rules can evaluate Cosmos DB metrics over time and trigger actions when thresholds remain exceeded. An alert for sustained HTTP 429 throttling can warn operators that available throughput is insufficient or that a hot partition may exist. An action group can send email, SMS, webhook notifications, or start automation. Unique keys, TTL, and stored procedures do not provide capacity monitoring. Proactive alerting helps teams respond before throttling becomes prolonged and significantly affects application performance.