Free DP-420 Exam Braindumps
Designing and Implementing Cloud-Native Applications Using Microsoft Azure Cosmos DB Questions 11–15 (page: 4)

Updated On: 16-Nov-2026
View Related Case Study

HOTSPOT (Drag and Drop is not supported)
You have an Azure subscription that contains an Azure Cosmos DB for NoSQL account. The account hosts a container named Container1 that stores customer data. Each customer data item includes the customer’s name and zero or more related business categories in an array.
You need identify customers that have one of their business categories set to “retail”. The solution must return the customerName and businessCategories fields.
How should you complete the query? To answer, select the appropriate options in the answer area.
Note: Each correct selection is worth one point.
Hot Area:

  1. See Explanation section for answer.

Answer(s): A

Explanation:



Box 1: EXISTS
In Azure Cosmos DB, the EXISTS keyword is used with a subquery to determine if a specific value exists within a nested array. The syntax SELECT VALUE bc FROM bc IN c.businessCategories WHERE bc = "retail" creates a temporary set from the array elements and returns true if any element matches the filter.
Box 2: VALUE
Incorrect:
* ARRAY_CONTAINS
Standard way to handle this, but does not work well in subqueries.


Reference:

https://devblogs.microsoft.com/cosmosdb/understanding-how-to-query-arrays-in-azure-cosmos-db/



View Related Case Study

You have an Azure subscription that contains an Azure Cosmos DB for NoSQL account.
You need to write a SQL query that will return multiple items. The solution must meet the following requirements:
-For each item returned, include the current Coordinated Universal Time (UTC) date and time, formatted as an ISO 8601 string.
-Minimize development effort.
What should you use?

  1. a user-defined function
  2. GetCurrentTimestamp()
  3. GetCurrentDateTime()
  4. DateTimePart()

Answer(s): B

Explanation:

GetCurrentTimestamp() is a built-in system function in Azure Cosmos DB's SQL API, which returns the current Coordinated Universal Time (UTC) in ISO 8601 format as a string. It can be used directly in a SQL query without any additional effort. This approach minimizes development effort because it doesn't require custom logic or user-defined functions.



View Related Case Study

HOTSPOT (Drag and Drop is not supported)
You have an Azure subscription. The subscription contains an Azure Cosmos DB for NoSQL account named account1 that hosts a container named Container1. Container1 has the analytical store enabled.
You have an Azure Synapse Analytics workspace named Workspace1. Workspace1 contains an Apache Spark pool named Spark1 that runs Spark3. Workspace1 contains the Azure Synapse Link for an Azure Cosmos DB database named DB1.
You need to write the content of a DataFrame to Container1.
How should you complete the code? To answer, select the appropriate options in the answer area.
Note: Each correct selection is worth one point.
Hot Area:

  1. See Explanation section for answer.

Answer(s): A

Explanation:



Box 1: ("cosmos.oltp")\
To write the content of a Spark DataFrame to an Azure Cosmos DB for NoSQL container using Spark 3 and the Azure Cosmos DB Spark connector, you should use the transactional store format (OLTP)-
Code example:
df.write.format("cosmos.oltp") \
.option("spark.synapse.linkedService", "mycosmosdatabase") \
.option("spark.cosmos.container", "MyContainer") \
.mode('append') \
.save()
Box 2: spark.synapse.linkedService
To write the content of a DataFrame using the Spark 3 OLTP connector in an Azure Synapse Analytics notebook via a linked service, you must use spark.synapse.linkedService.
spark.synapse.linkedService is the correct configuration property when leveraging Azure Synapse Link within a Synapse Spark notebook. It allows Spark to authenticate and connect directly to Azure Cosmos DB through the workspace's configured Linked Service.


Reference:

https://stackoverflow.com/questions/76471055/how-to-run-spark-3-3-0-cosmos-oltp-connector-in-batch-mode



View Related Case Study

HOTSPOT (Drag and Drop is not supported)
You have the Azure Cosmos DB for NoSQL containers shown in the following table.

You have the items shown in the following table.

When will each item expire? To answer, select the appropriate options in the answer area.
Note: Each correct selection is worth one point.
Hot Area:

  1. See Explanation section for answer.

Answer(s): A

Explanation:



Box 1: 60 seconds
Item1 is in container1.
Item1 TimeToLive is 60.
Container1 DefaultTimeToLive is -1.
60 overrides -1.
Box 2: Never
Item2 is in container2.
Item2 TimeToLive is 10.
Container1 DefaultTimeToLive null.
Null overrides 10, and items in container2 are never expired.
Box 3: Never
Item3 is in container3.
Item23TimeToLive is -1.
Container1 DefaultTimeToLive 60.
-1 overrides 60. Item3 is never expired.
Note: With Time to Live or TTL, Azure Cosmos DB provides the ability to delete items automatically from a container after a certain time period. By default, you can set time to live at the container level and override the value on a per-item basis. After you set the TTL at a container or at an item level, Azure Cosmos DB will automatically remove these items after the time period, since the time they were last modified.
Time to live for containers and items
The time to live value is set in seconds, and it is interpreted as a delta from the time that an item was last modified. You can set time to live on a container or an item within the container:
1. Time to Live on a container (set using DefaultTimeToLive):
If missing (or set to null), items are not expired automatically.
If present and the value is set to "-1", it is equal to infinity, and items don’t expire by default.
If present and the value is set to some non-zero number "n" – items will expire "n" seconds after their last modified time.
2. Time to Live on an item (set using ttl):
This Property is applicable only if DefaultTimeToLive is present and it is not set to null for the parent container.
If present, it overrides the DefaultTimeToLive value of the parent container.


Reference:

https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/time-to-live



View Related Case Study

You plan to store order data in an Azure Cosmos DB for NoSQL account. The data contains information about orders and their associated items.
You need to develop a model that supports read operations for orders. The solution must minimize the number of requests.
What should you do?

  1. Create a database for orders and a database for order items.
  2. Create a single database that contains a container for orders and a container for order items.
  3. Create a single database that contains one container. Store orders and order items in separate documents in the container.
  4. Create a single database that contains one container. Create a separate document for each order and embed the order items into the order documents.

Answer(s): D

Explanation:

By denormalizing data, your application may need to issue fewer queries and updates to complete common operations.
Typically denormalized data models provide better read performance.
Note: In general, use embedded data models when:
There are contained relationships between entities.
There are one-to-few relationships between entities.
There's embedded data that changes infrequently.
There's embedded data that will not grow without bound.
There's embedded data that is queried frequently together.


Reference:

https://docs.microsoft.com/en-us/azure/cosmos-db/sql/modeling-data



Viewing page 4 of 61
Viewing questions 16 - 20 out of 296 questions


Post your Comments and Discuss Microsoft DP-420 exam prep with other Community members:

AI Tutor AI Tutor 👋 I’m here to help!