Courseiva
Data Modeling →easyMultiple Choice

C100DEV Data Modeling Practice Question

A retail catalog team stores each product as a document. Products share core fields such as sku, name, and price, but electronics carry warrantyMonths while apparel carries sizeChart. The application queries all products uniformly by category and price. Which modeling approach best fits this requirement?

⚠ Common exam trap

The trap here is treating MongoDB like a relational database and assuming each variant shape needs its own table or a fixed set of columns, when a single collection with optional fields is the intended design.

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

✓

Store all products in one collection and allow documents to carry category-specific fields alongside the shared fields.

MongoDB schemas are flexible by design, so a single products collection can hold documents that share common fields and add category-specific ones as needed. This supports one uniform query path indexed on category and price, avoids joins, and lets new categories be introduced without schema migrations. Splitting collections or normalizing into fixed keys adds routing and storage costs that the scenario does not justify.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Store category-specific attributes in a separate attributes collection and $lookup them when rendering each product.

    Why it's wrong here

    Moving attributes to a side collection adds a join for every product render and prevents indexing the varying fields for direct filtering. Since the attributes are read together with the product and are bounded in number, the join is pure overhead. It also complicates writes, which must now update two collections atomically or accept inconsistency.

  • ✗

    Normalize the schema by storing all category-specific fields in a shared subdocument with a fixed set of keys for every product.

    Why it's wrong here

    Forcing every product to carry every possible attribute wastes storage and creates documents full of nulls or placeholders, which is a relational habit that does not suit MongoDB. It also makes adding a new category require touching all documents or the application's fixed key list, so it is less flexible than simply allowing optional fields.

  • ✓

    Store all products in one collection and allow documents to carry category-specific fields alongside the shared fields.

    Why this is correct

    Keeping one collection with shared core fields plus optional category-specific fields lets a single indexed query on category and price serve every product. MongoDB does not require uniform document shape, so the polymorphic documents coexist cleanly, and the application handles optional fields only where relevant. This matches the uniform query requirement with the least complexity.

  • ✗

    Create a separate collection per product category so each collection has a uniform schema.

    Why it's wrong here

    Separate collections force the application to know which collection to query for each category and make cross-category queries such as price-range searches across all products require multiple round trips or a manual union. The scenario states products are queried uniformly, so splitting collections adds routing complexity without any compensating benefit.

About these practice questions

One of 259 original C100DEV practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

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.