MongoDB Questions and Answers – Data Modeling Introduction

This set of MongoDB Multiple Choice Questions & Answers (MCQs) focuses on “Data Modeling Introduction”.

1. ________ store the relationships between data by including links or references from one document to another.
a) Capped
b) Embedded
c) External
d) References
View Answer

Answer: d
Explanation: Applications can resolve these references to access the related data. Broadly, these are normalized data models.

2. Point out the correct statement.
a) In practice, the documents in a collection share a different structure
b) Data in MongoDB has a flexible schema
c) The key challenge in data modeling is balancing the needs of the application, the performance characteristics of the database engine, and the data retrieval patterns
d) None of the mentioned
View Answer

Answer: b
Explanation: MongoDB’s collections do not enforce document structure.

3. In MongoDB, write operations are atomic at the __________ level.
a) collection
b) document
c) row
d) all of the mentioned
View Answer

Answer: b
Explanation: No single write operation can atomically affect more than one document or more than one collection.

4. ______________ documents capture relationships between data by storing related data in a single document structure.
a) Capped
b) Embedded
c) External
d) Internal
View Answer

Answer: b
Explanation: MongoDB documents make it possible to embed document structures in a field or array within a document.

advertisement
advertisement

5. Point out the wrong statement.
a) The key decision in designing data models for MongoDB applications revolves around the structure of documents and how the application represents relationships between data
b) There are two tools that allow applications to represent these relationships: references and embedded documents
c) When designing data models, always consider the application usage of the data (i.e. queries, updates, and processing of the data) as well as the inherent structure of the data itself
d) All of the mentioned
View Answer

Answer: d
Explanation: Denormalized data models allow applications to retrieve and manipulate related data in a single database operation.

6. A ____________ data model with embedded data combines all related data for a represented entity in a single document.
a) normalized
b) denormalized
c) non relational
d) relational
View Answer

Answer: b
Explanation: This facilitates atomic write operations since a single write operation can insert or update the data for an entity.

Note: Join free Sanfoundry classes at Telegram or Youtube

7. For the __________ storage engine, if the document size exceeds the allocated space for that document, MongoDB relocates the document on disk.
a) MAPv1
b) MAPv2
c) MAPv3
d) MAPv4
View Answer

Answer: c
Explanation: Normalizing the data would split the data across multiple collections and would require multiple write operations that are not atomic collectively.

8. With MongoDB 3.0.0, the default use of the Power of _________ Allocations minimizes the occurrences of re-allocations as well as allows for the effective reuse of the freed record space.
a) 2 Sized
b) 3 Sized
c) 4 Sized
d) 5 Sized
View Answer

Answer: a
Explanation: When using MMAPv1, if your applications require updates that will frequently cause document growth to exceeds the current power of 2 allocation, you may want to refactor your data model to use references between data in distinct documents rather than a denormalized data model.

advertisement

9. ___________ strategy is used to explicitly avoid document growth.
a) deallocation
b) allocation
c) pre-allocation
d) none of the mentioned
View Answer

Answer: c
Explanation: A data model that embeds related data in a single document facilitates atomic operations.

10. Each index in MongoDB requires at least _________ of data space.
a) 8KB
b) 28KB
c) 68KB
d) 108KB
View Answer

Answer: a
Explanation: Adding an index has some negative performance impact for write operations.

advertisement

Sanfoundry Global Education & Learning Series – MongoDB.

Here’s the list of Best Books in MongoDB.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.