Courseiva
Data Modeling →mediumMultiple Choice

C100DEV Data Modeling Practice Question

An e-commerce application stores products with fluctuating attributes. Which data modeling pattern is most effective for handling diverse product schemas while maintaining efficient filtering?

⚠ Common exam trap

Candidates often suggest using a wildcard index for heterogeneous data, ignoring that the Attribute Pattern is specifically designed for efficient, indexable filtering on diverse, dynamic key-value pairs.

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

✓

Implementing the Attribute Pattern with an array of key-value pairs.

The Attribute Pattern is the standard solution for schemas with heterogeneous fields. By transforming fields into an array of key-value pairs (k: 'color', v: 'red'), you create a uniform structure that allows for single-index coverage across all attributes. This avoids the limitations of sparse indexes and allows the application to query arbitrary attributes without needing to modify the document structure or rebuild large index sets frequently.

Answer analysis

Option-by-option breakdown

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

  • ✗

    Embedding every possible attribute as a top-level field in the document.

    Why it's wrong here

    Adding every possible attribute as a top-level field creates a sparse document with many null values. This leads to inefficient storage and complicates indexing because you would need many sparse indexes to cover all potential attributes, which does not scale well as the number of product categories grows over time.

  • ✗

    Storing all product attributes as a single large JSON blob string.

    Why it's wrong here

    Storing data as a raw string prevents MongoDB from performing server-side operations like filtering, sorting, or aggregation on specific attributes. You would be forced to pull the entire blob into application memory, destroying query performance and negating the benefit of using a document database for data access patterns.

  • ✓

    Implementing the Attribute Pattern with an array of key-value pairs.

    Why this is correct

    This pattern creates a standardized structure that allows you to index the key and value fields uniformly. It enables efficient queries across different product types without modifying the schema, ensuring that MongoDB can perform high-performance index lookups regardless of which specific attributes are stored for a given document.

  • ✗

    Creating a separate collection for every individual product category.

    Why it's wrong here

    Creating collection-per-category leads to massive administrative overhead and prevents cross-category aggregation. MongoDB performs best when similar data is stored within the same collection, allowing for shared indexes and efficient queries that span your entire product catalog, rather than requiring complex joins or multiple application-side merge operations.

About these practice questions

This C100DEV question is part of Courseiva's 259-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. 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.