MongoDB Data Modeling Quiz: Collections u0026 Documents Quiz

  1. Question 1

    In MongoDB, what is the equivalent of a table in a relational database?

    1. Document
    2. Field
    3. Collection
    4. Index
    5. Database
  2. Question 2

    Which data type is most suitable for storing an array of product IDs in a MongoDB document?

    1. String
    2. Number
    3. Array
    4. Object
    5. Boolean
  3. Question 3

    What is the primary benefit of embedding documents in MongoDB?

    1. Reduced storage space
    2. Simplified queries for related data
    3. Increased data redundancy
    4. Improved data security
    5. Elimination of indexes
  4. Question 4

    When should you consider using document referencing over embedding in MongoDB?

    1. When the related data is small and rarely changes
    2. When you need to query related data frequently
    3. When the relationship is one-to-one
    4. When the relationship is many-to-many or one-to-many and data grows significantly
    5. When you want to avoid joins
  5. Question 5

    What is the purpose of the `$lookup` aggregation pipeline stage in MongoDB?

    1. To update multiple documents
    2. To perform a left outer join to another collection
    3. To filter documents based on a condition
    4. To sort documents in ascending order
    5. To project specific fields in a document
  6. Question 6

    Which of the following is NOT a consideration when designing a schema for MongoDB?

    1. Data access patterns
    2. Data relationships
    3. Data size
    4. Database vendor (Oracle, MySQL)
    5. Read and write ratios
  7. Question 7

    What is the purpose of denormalization in MongoDB data modeling?

    1. To reduce data redundancy
    2. To improve query performance by avoiding joins
    3. To enforce strict data consistency
    4. To minimize storage space
    5. To simplify data validation
  8. Question 8

    In MongoDB, what is the maximum document size limit?

    1. 4 MB
    2. 8 MB
    3. 16 MB
    4. 32 MB
    5. 64 MB
  9. Question 9

    Which data modeling approach is preferable if you need to ensure strong consistency across related data?

    1. Embedding
    2. Referencing
    3. Denormalization
    4. Normalization
    5. Polymerization
  10. Question 10

    Consider a blog application. Which approach is generally better for storing comments related to a post: embedding comments within the post document, or referencing comments in a separate 'comments' collection?

    1. Embedding, because comments are usually short and retrieval is faster.
    2. Referencing, because comments can grow unboundedly and impact post document size.
    3. Embedding, to normalize the comments.
    4. Referencing, only if you want to enable different databases for posts and comments.
    5. Embedding, it's better for consistency.