C100DEV MongoDB Overview and Document Model Practice Question
A development team is migrating a legacy application to MongoDB. They need to store product inventory data that includes a unique identifier, a name, a price, and a list of warehouse locations with quantities. The team wants to minimize the number of queries required to retrieve all information for a product. Which MongoDB document design approach best meets this requirement?
⚠ Common exam trap
The trap here is assuming that referencing is always better for one-to-many relationships, but embedding is preferred when data is accessed together and query minimization is key.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Embed the warehouse locations as an array of subdocuments within the product document.
Embedding related data within a single document aligns with MongoDB's document model and supports atomic operations and efficient reads. By embedding warehouse locations as an array, the application retrieves the full product inventory in one query, which is optimal for this access pattern. Referencing or normalizing would require additional queries or application-side joins, increasing latency and complexity.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Embed the warehouse locations as an array of subdocuments within the product document.
Why this is correct
Embedding warehouse locations as an array within the product document stores all related data in a single document. This allows the application to retrieve the complete product information, including inventory per warehouse, with a single query, minimizing the number of queries and improving read performance for this access pattern.
- ✗
Store warehouse locations in a separate collection and reference them by ObjectId from the product document.
Why it's wrong here
Using references requires an additional query to fetch the warehouse data, which increases the number of queries needed to retrieve all information for a product. While referencing can be useful for large or independently accessed data, it does not meet the requirement to minimize queries in this scenario.
- ✗
Normalize the data into multiple collections: products, warehouses, and inventory, with foreign key relationships.
Why it's wrong here
Normalizing into multiple collections with foreign keys is a relational approach that would require joins or multiple queries to assemble the complete product view. MongoDB does not support joins natively in the same way, and this design would increase query complexity and count, contrary to the goal.
- ✗
Store each warehouse location as a separate document in the same collection as products.
Why it's wrong here
Storing warehouse locations as separate documents in the product collection would mix different entity types and still require multiple queries to gather all locations for a product. This approach lacks a clear relationship and does not ensure a single query retrieves all related data, making it inefficient.
About these practice questions
Courseiva writes every C100DEV question from scratch — 259 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official MongoDB exam blueprint
This C100DEV practice question is part of Courseiva's free MongoDB certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the C100DEV exam.