DP-420
Free DP-420 practice questions
10 questions from our DP-420 practice tests, each with the correct answer and a written explanation. Read them with the answers shown, or switch to quiz mode and answer first.
Question 1 of 10, Design and develop database solutions
An IoT container is partitioned by /deviceId. A few very chatty devices send most of the writes, and Normalized RU Consumption shows one physical partition at 100% while the others stay low. The team must keep point reads by device and time window efficient. Which partition key change is MOST appropriate?
- AUse /readingType as the key because there are only five reading types and each is evenly used
- BUse a synthetic key that combines deviceId with the reading date, such as device42-2026-11-08 Correct answer
- CKeep /deviceId and increase the container throughput until the hot partition stops throttling
- DUse /readingType as the partition key because there are only five reading types and each is evenly used
Answer and explanation: A synthetic key of deviceId plus date spreads a chatty device's writes across many logical partitions, and readers can still compute the key for a device and date to do targeted reads. A five-value key has very low cardinality and creates even hotter partitions. Partitioning by id spreads writes but makes reads by device a fan-out query. Raising throughput divides it evenly across physical partitions, so the hot partition gets only a fraction of the increase.
Question 2 of 10, Design and develop database solutions
An event log container uses the event date in yyyy-MM-dd format as its partition key. Writes keep slowing down with 429 errors even after throughput increases, while most physical partitions are nearly idle. What is the root cause and the BEST fix?
- AAll writes for the current day hit one logical partition; use a key such as sourceId or a date plus a hash suffix Correct answer
- BThe container has too few physical partitions; split the container manually into more physical partitions
- CThe account uses session consistency; switch to eventual consistency so that writes are acknowledged faster
- DThe indexing policy is too large; exclude all paths so that each write costs far fewer request units than before
Answer and explanation: A date key concentrates every write of the day in one logical partition and therefore one physical partition, so extra throughput spread across partitions does not help; a higher-cardinality key or synthetic suffix spreads the load. Physical partitions are managed by the service, and more of them would not move today's partition. Excluding all paths lowers write cost but breaks queries and leaves the hot spot. Consistency does not change write distribution.
Question 3 of 10, Design and develop database solutions
A container holds customers, orders and invoices with a type discriminator, partitioned by /customerId. Throughput is shared across all entity types, and most requests read a customer with their recent orders. A colleague proposes moving each entity type into its own container. What is the MAIN downside of that proposal?
- ATransactional batches would get faster because each container holds fewer items
- BEach container could hold only one type of document, so the type discriminator property would have to be removed
- CChange feed processors could no longer read the separate containers because they would have different schemas
- DReading a customer with its orders would need requests to several containers instead of one query Correct answer
Answer and explanation: Co-locating related entity types in one container with the same partition key lets the app fetch a customer and recent orders in one single-partition query and update them in one transactional batch; splitting them adds requests and removes that transaction scope. Containers are schema-agnostic, so a discriminator is still possible. Batches cannot span containers, so they would not become faster. Change feed works on any container regardless of schema.
Question 4 of 10, Design and develop database solutions
A blog platform stores posts with comments. A post typically has a handful of comments, but popular posts receive tens of thousands, and comments are usually displayed 20 at a time. How should comments be modeled?
- AStore comments as separate documents in the same container with the postId as their partition key Correct answer
- BStore all comments in one shared document per day that every post references by its date value
- CEmbed the comments in the post document and split the array into a new post version every month
- DEmbed all comments in an array inside the post document so a single point read returns the post and its comments
Answer and explanation: Unbounded one-to-many relationships should be referenced, and storing comments as separate items partitioned by postId keeps a post and its comments in one logical partition for efficient paged queries. Embedding an unbounded array risks the 2 MB item limit and makes every comment write rewrite the whole post. Splitting by month still grows without limit for busy months. A shared daily document creates a write hot spot and unrelated data in one item.
Question 5 of 10, Design and develop database solutions
Students can enroll in many courses, and each course has many students. The app shows a student's courses and a course's roster with equal frequency, and enrollments change daily. Which model is BEST?
- AEmbed the full roster array in each course and the full course list array in each student and update both arrays
- BStore enrollments only in a container keyed by courseId and query students cross-partition
- CStore each student and course in a single item that holds every enrollment of the entire school in one array
- DStore enrollments in two containers, one keyed by studentId and one by courseId, synced by change feed Correct answer
Answer and explanation: For a many-to-many relationship queried from both sides, duplicating enrollments into containers partitioned for each access pattern, kept in sync with change feed, makes both reads single-partition. Embedding arrays on both sides requires two writes per enrollment and grows unbounded. One container keyed by course makes student lookups fan out. A single item for the whole school exceeds size limits and creates contention.
Question 6 of 10, Secure, optimize, and deploy database solutions
A healthcare app stores patient records in Azure Cosmos DB. Regulations require that the database service and administrators never see the plaintext of the SSN field, but the app must still look up patients by exact SSN. Which approach meets both requirements?
- ADynamic data masking on the /ssn path so that only privileged Entra identities see the plaintext value
- BCustomer-managed keys in Azure Key Vault for the account encryption at rest of all data
- CAlways Encrypted with a client encryption policy that uses randomized encryption on /ssn
- DAlways Encrypted with a client encryption policy that uses deterministic encryption on /ssn Correct answer
Answer and explanation: Always Encrypted encrypts the field on the client so the service never sees plaintext, and deterministic encryption produces the same ciphertext for the same value, which allows equality filters. Randomized encryption is stronger but prevents filtering on the field. Customer-managed keys protect data at rest, but the service still decrypts it for processing. Dynamic data masking hides values from some readers but the service and privileged users still see plaintext.
Question 7 of 10, Secure, optimize, and deploy database solutions
A DevOps team wants to make sure that applications using account keys can still read and write items but cannot create, delete or change the throughput of databases and containers. Changes must go through ARM templates. Which setting should they configure?
- AdisableLocalAuth set to true so that only Entra ID is accepted
- BA read-only resource lock on the account resource group in Azure
- CThe Cosmos DB Operator role assigned to every application identity
- DdisableKeyBasedMetadataWriteAccess set to true on the account Correct answer
Answer and explanation: disableKeyBasedMetadataWriteAccess prevents SDK clients that use keys from changing metadata such as databases, containers and throughput while data operations keep working, so changes must come through Azure Resource Manager. disableLocalAuth blocks key usage entirely, breaking those applications. Cosmos DB Operator is a control-plane role and does not affect key-based SDK calls. A read-only lock also blocks legitimate ARM deployments and some account operations.
Question 8 of 10, Secure, optimize, and deploy database solutions. Choose 2.
An application uses multi-region writes. The team wants to improve availability during regional outages and keep latency low. Which TWO actions are recommended? (Choose two.)
- ADisable service-managed failover because it is required to be off for multi-region writes
- BEnable availability zone support in regions where zone redundancy is offered for the account Correct answer
- CStore all data in a single logical partition so that conflicts can be detected quickly
- DSet the default consistency level of the account to strong to avoid write conflicts
- EConfigure ApplicationPreferredRegions in the SDK so each instance writes to its nearest region Correct answer
Answer and explanation: Preferred regions let each app instance use its nearest region and fail over to others automatically, and zone redundancy protects against zone failures inside a region. Strong consistency is not supported with multi-region writes. A single logical partition limits scale and does nothing for availability. Service-managed failover does not have to be disabled for multi-region writes, and turning settings off does not improve availability.
Question 9 of 10, Implement AI and analytics capabilities in database solutions
A developer will store 1,536-dimension float32 embeddings in a /embedding property of each item and wants to run similarity searches on it in Azure Cosmos DB for NoSQL. Which container-level setting describes the path, data type, dimensions and distance function of the vectors?
- AThe vector embedding policy Correct answer
- BThe computed properties definition of the container
- CThe full text policy of the container
- DThe unique key policy of the container
Answer and explanation: The vector embedding policy declares each vector path with its data type, number of dimensions and distance function, and the indexing policy then references the path in its vector indexes. The full text policy configures text search paths and languages. A unique key policy enforces uniqueness within a logical partition. Computed properties derive values from item properties but do not describe vectors.
Question 10 of 10, Implement AI and analytics capabilities in database solutions
An embeddings container uses the cosine distance function. The team switches to a model that outputs 3,072-dimension vectors instead of 1,536. What must be updated so that searches work correctly?
- AThe vector embedding policy dimensions, which in practice means creating a new container and re-embedding the data Correct answer
- BOnly the distance function in the vector embedding policy, from cosine to dotproduct, to match the larger vectors
- COnly the query, by passing a dimensions argument of 3,072 to VectorDistance for each search against the container
- DOnly the indexing policy, by adding a second range index on the embedding path for the new 3,072-element vector arrays
Answer and explanation: The declared dimensions in the vector embedding policy must match the embeddings, and vectors from different models are not comparable, so the data must be re-embedded into a container whose policy declares the new size. VectorDistance has no dimensions argument that overrides the policy. The distance function is unrelated to dimensions. A range index does not support similarity search.