Microsoft certification · Exam DP-420

DP-420 Mock Exam

Designing and Implementing Cloud-Native Applications Using Microsoft Azure Cosmos DB

Free DP-420 questions on Topic 2: Misc. Questions, each with the answer and an explanation.

14 questions · 23 minutes · free, no sign-up

Topic 2: Misc. Questions questions

1–10 of 13 free
Question 1 Choose 3

You need to configure an Apache Kafka instance to ingest data from an Azure Cosmos DB
Core (SQL) API account. The data from a container named telemetry must be added to a
Kafka topic named iot. The solution must store the data in a compact binary format.
Which three configuration items should you include in the solution? Each correct answer
presents part of the solution.
NOTE: Each correct selection is worth one point.

Show answerHide answer

Correct answer: C, D, F

"key.converter": "io.confluent.connect.avro.AvroConverter"

"connect.cosmos.containers.topicmap": "iot#telemetry"

"connector.class": "com.azure.cosmos.kafka.connect.source.CosmosDBSinkConnector"

Explanation

Explanation:
C: Avro is binary format, while JSON is text.
F: Kafka Connect for Azure Cosmos DB is a connector to read from and write data to Azure
Cosmos DB. The Azure Cosmos DB sink connector allows you to export data from Apache
Kafka topics to an Azure Cosmos DB database. The connector polls data from Kafka to
write to containers in the database based on the topics subscription.
D: Create the Azure Cosmos DB sink connector in Kafka Connect. The following JSON
body defines config for the sink connector.
Extract:
"connector.class": "com.azure.cosmos.kafka.connect.sink.CosmosDBSinkConnector",
"key.converter": "org.apache.kafka.connect.json.AvroConverter"
"connect.cosmos.containers.topicmap": "hotels#kafka"
Reference:
https://docs.microsoft.com/en-us/azure/cosmos-db/sql/kafka-connector-sink
https://www.confluent.io/blog/kafka-connect-deep-dive-converters-serialization-explained/

Question 2

You have an Azure Cosmos DB Core (SQL) API account that is configured for multi-region
writes. The account contains a database that has two containers named container1 and
container2.
The following is a sample of a document in container1:
{
"customerId": 1234,
"firstName": "John",
"lastName": "Smith",
"policyYear": 2021
}
The following is a sample of a document in container2:
{
"gpsId": 1234,
"latitude": 38.8951,
"longitude": -77.0364
}
You need to configure conflict resolution to meet the following requirements:
For container1 you must resolve conflicts by using the highest value for policyYear.
For container2 you must resolve conflicts by accepting the distance closest to latitude:
40.730610 and longitude: -73.935242.
Administrative effort must be minimized to implement the solution.
What should you configure for each container? To answer, drag the appropriate
configurations to the correct containers. Each configuration may be used once, more than
once, or not at all. You may need to drag the split bar between panes or scroll to view
content.
NOTE: Each correct selection is worth one point.

Show answerHide answer

Explanation

Question 3 Choose 1

You have an application named App1 that reads the data in an Azure Cosmos DB Core
(SQL) API account. App1 runs the same read queries every minute. The default
consistency level for the account is set to eventual.
You discover that every query consumes request units (RUs) instead of using the cache.
You verify the IntegratedCacheiteItemHitRate metric and the
IntegratedCacheQueryHitRate metric. Both metrics have values of 0.
You verify that the dedicated gateway cluster is provisioned and used in the connection string.
You need to ensure that App1 uses the Azure Cosmos DB integrated cache.
What should you configure?

Show answerHide answer

Correct answer: C

the connectivity mode of the App1 CosmosClient

Explanation

Explanation: Because the integrated cache is specific to your Azure Cosmos DB account
and requires significant CPU and memory, it requires a dedicated gateway node. Connect
to Azure Cosmos DB using gateway mode.
Reference: https://docs.microsoft.com/en-us/azure/cosmos-db/integrated-cache-faq

Question 4 Choose 1

You have the following query.
SELECT * FROM
WHERE c.sensor = "TEMP1"
AND c.value < 22
AND c.timestamp >= 1619146031231
You need to recommend a composite index strategy that will minimize the request units
(RUs) consumed by the query.
What should you recommend?

Show answerHide answer

Correct answer: A

a composite index for (sensor ASC, value ASC) and a composite index for (sensor ASC,
timestamp ASC)

Explanation

If a query has a filter with two or more properties, adding a composite index will improve
performance.
Consider the following query:
SELECT * FROM c WHERE c.name = “Tim” and c.age > 18
In the absence of a composite index on (name ASC, and age ASC), we will utilize a range
index for this query. We can improve the efficiency of this query by creating a composite
index for name and age.
Queries with multiple equality filters and a maximum of one range filter (such as >,<, <=,
>=, !=) will utilize the composite index.
Reference: https://azure.microsoft.com/en-us/blog/three-ways-to-leverage-compositeindexes-
in-azure-cosmos-db/

Question 5

You have an app that stores data in an Azure Cosmos DB Core (SQL) API account The
app performs queries that return large result sets.
You need to return a complete result set to the app by using pagination. Each page of
results must return 80 items.
Which three actions should you perform in sequence? To answer, move the appropriate
actions from the list of actions to the answer area and arrange them in the correct order.

Show answerHide answer

Explanation

Question 6 Choose 1

You have a container named container1 in an Azure Cosmos DB Core (SQL) API account.
You need to provide a user named User1 with the ability to insert items into container1 by
using role-based access control (RBAC). The solution must use the principle of least
privilege.
Which roles should you assign to User1?

Show answerHide answer

Correct answer: A

CosmosDB Operator only

Explanation

Explanation:
Cosmos DB Operator: Can provision Azure Cosmos accounts, databases, and containers.
Cannot access any data or use Data Explorer.
Reference: https://docs.microsoft.com/en-us/azure/cosmos-db/role-based-access-control

Question 7

You plan to deploy two Azure Cosmos DB Core (SQL) API accounts that will each contain
a single database. The accounts will be configured as shown in the following table.

Show answerHide answer

Explanation

Question 8

You have an Azure Cosmos DB Core (SQL) API account named account1.
You have the Azure virtual networks and subnets shown in the following table.

Show answerHide answer

Explanation

Question 9 Choose 3

You plan to create an Azure Cosmos DB Core (SQL) API account that will use customermanaged
keys stored in Azure Key Vault.
You need to configure an access policy in Key Vault to allow Azure Cosmos DB access to
the keys.
Which three permissions should you enable in the access policy? Each correct answer
presents part of the solution.
NOTE: Each correct selection is worth one point.

Show answerHide answer

Correct answer: A, B, G

Wrap Key

Get

Unwrap Key

Explanation

Reference: https://docs.microsoft.com/en-us/azure/cosmos-db/how-to-setup-cmk

Question 10 Choose 1

You have an Azure Cosmos DB Core (SQL) API account.
You configure the diagnostic settings to send all log information to a Log Analytics
workspace.
You need to identify when the provisioned request units per second (RU/s) for resources
within the account were modified.
You write the following query.
AzureDiagnostics
| where Category == "ControlPlaneRequests"
What should you include in the query?

Show answerHide answer

Correct answer: A

| where OperationName startswith "AccountUpdateStart"

Explanation

Explanation:
The following are the operation names in diagnostic logs for different operations:
RegionAddStart, RegionAddComplete
RegionRemoveStart, RegionRemoveComplete
AccountDeleteStart, AccountDeleteComplete
RegionFailoverStart, RegionFailoverComplete
AccountCreateStart, AccountCreateComplete
*AccountUpdateStart*, AccountUpdateComplete
VirtualNetworkDeleteStart, VirtualNetworkDeleteComplete
DiagnosticLogUpdateStart, DiagnosticLogUpdateComplete
Reference: https://docs.microsoft.com/en-us/azure/cosmos-db/audit-control-plane-logs

Full mock exam

Sit the DP-420 exam before exam day

Full-length mocks with the same number of questions and the same time limit as the real DP-420 exam. Every attempt draws a new set of questions from the full bank, so you can keep going until you pass comfortably.

Get full DP-420 mock exam
  • 65questions per mock
  • 105 mintime limit
  • 51questions in the bank
  • Newmock on every attempt