Microsoft Designing and Implementing Cloud-Native Applications Using Microsoft Azure Cosmos DB - DP-420 Exam Practice Test

Question 1
Your company develops an application named App1 that uses the Azure Cosmos DB SDK and the Eventual consistency level.
App1 queries an Azure Cosmos DB for NoSQL account named account1.
You need to identify which consistency level to assign to App1 to meet the following requirements:
- Maximize the throughput of the queries generated by App1 without
increasing the number of request units currently used by the queries.
- Provide the highest consistency guarantees.
Which consistency level should you identify?

Correct Answer: B
Explanation: Only visible for Actualtests4sure members. You can sign-up / login (it's free).
Question 2
You have an Azure Cosmos DB database named database1 that contains a container named container1. The container1 container stores product data and has the following indexing policy.
Which path will be indexed?

Correct Answer: B
Question 3
Hotspot Question
You are developing an application that will connect to an Azure Cosmos DB for NoSQL account.
The account has a single read-write region and one additional read region. The regions are configured for automatic failover.
The account has the following connection strings. (Line numbers are included for reference only.)

For each of the following statements, select Yes if the statement is true. Otherwise, select No.
NOTE: Each correct selection is worth one point.
Correct Answer:

Explanation:
Box 1: No
The same connection string can still be used.
Azure Cosmos DB Core read write region connection strings
Azure Cosmos DB "primary write region" failover "connection string"
Box 2: No
The AccountEndpoint for both are the same.
Box 3: Yes
The ConnectionPolicy.PreferredLocations property gets and sets the preferred locations (regions) for geo-replicated database accounts in the Azure Cosmos DB service. For example, "East US" as the preferred location.
When EnableEndpointDiscovery is true and the value of this property is non-empty, the SDK uses the locations in the collection in the order they are specified to perform operations, otherwise if the value of this property is not specified, the SDK uses the write region as the preferred location for all operations.
Reference:
https://docs.microsoft.com/en-us/dotnet/api/microsoft.azure.documents.client.connectionpolicy.preferredlocations
Question 4
Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might have more than one correct solution, while others might not have a correct solution.
After you answer a question in this section, you will NOT be able to return to it. As a result, these questions will not appear in the review screen.
You have an Azure Cosmos DB for NoSQL account named account1 that uses autoscale throughput.
You need to run an Azure function when the normalized request units per second for a container in account1 exceeds a specific value.
Solution: You configure Azure Event Grid to send events to the function by using an Event Grid trigger in the function.
Does this meet the goal?

Correct Answer: A
Explanation: Only visible for Actualtests4sure members. You can sign-up / login (it's free).
Question 5
You have an Azure Cosmos DB for NoSQL container named Contained that has a provisioned throughput of 1,000 request units per second (RU/s). Contained is queried by using an app named App1.
Users of App1 report that several times a day, they receive the following error message: "HTTP error code 429" You need to improve the reliability of App1 without affecting the performance of the app.
What are two ways to improve the reliability? Each correct answer presents a complete solution.
NOTE: Each correct selection is worth one point.

Correct Answer: B,E
Explanation: Only visible for Actualtests4sure members. You can sign-up / login (it's free).
Question 6
You have a database in an Azure Cosmos DB for NoSQL account.
You need to create an Azure function that will access the database to retrieve records based on a variable named accountnumber. The solution must protect against SQL injection attacks.
How should you define the command statement in the function?

Correct Answer: A
Explanation: Only visible for Actualtests4sure members. You can sign-up / login (it's free).
Question 7
You have an application named App1 that reads the data in an Azure Cosmos DB for NoSQL 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?

Correct Answer: D
Explanation: Only visible for Actualtests4sure members. You can sign-up / login (it's free).
Question 8
Drag and Drop Question
You have an Azure Cosmos DB container named owners. Each item in owners represents an owner and their pets.
The following is a sample of the JSON

You are writing a query that will retrieve the average age of each pet owned by each owner, if the pet is older than two years.
How should you complete the query? To answer, drag the appropriate values to the correct targets. Each value 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.
Correct Answer:
Question 9
Hotspot Question
You have an Azure subscription that contains an Azure Cosmos DB for NoSQL account.
You define and implement an encryption policy by using the following C# code:

For each of the following statements, select Yes if the statement is true, otherwise select No.
NOTE: Each correct selection is worth one point.
Correct Answer:
Question 10
You have an Azure Cosmos DB for NoSQL database named db1 that writes to multiple Azure regions.
You need to test the performance of db1 in the secondary region.
Which command should you run first?

Correct Answer: D
Explanation: Only visible for Actualtests4sure members. You can sign-up / login (it's free).
Question 11
Hotspot Question
You have a container named container1 in an Azure Cosmos DB for NoSQL account named account1.
You configure container1 to use Always Encrypted by using an encryption policy as shown in the C# and the Java exhibits. (Click the C# tab to view the encryption policy in C#.

Click the Java tab to see the encryption policy in Java.)

For each of the following statements, select Yes if the statement is true. Otherwise, select No.
NOTE: Each correct selection is worth one point.
Correct Answer:

Explanation:
Box 1: No
The creditcard property uses randomized encryption.
Randomized encryption is more secure, but prevents queries from filtering on encrypted properties.
Box 2: Yes
The SSN property uses deterministic encryption.
Using deterministic encryption allows queries to perform equality filters on encrypted properties.
Box 3: Yes
Reading documents when only a subset of properties can be decrypted.
In situations where the client does not have access to all the CMK used to encrypt properties, only a subset of properties can be decrypted when data is read back. For example, if property1 was encrypted with key1 and property2 was encrypted with key2, a client application that only has access to key1 can still read data, but not property2. In such a case, you must read your data through SQL queries and project away the properties that the client can't decrypt: SELECT c.property1, c.property3 FROM c.
Reference:
https://docs.microsoft.com/en-us/azure/cosmos-db/how-to-always-encrypted