MongoDB MCQ Questions - Data Modeling
This section focuses on "Data Modeling" in MongoDB. These Multiple Choice Questions (MCQ) should be practiced to improve the MongoDB skills required for various interviews (campus interview, walk-in interview, company interview), placements, entrance exams and other competitive examinations.
1. Each index in MongoDB requires at least _________ of data space.
A. 8KB
B. 16KB
C. 32KB
D. 64KB
View Answer
Ans : A
Explanation: Adding an index has some negative performance impact for write operations.
2. In MongoDB, At which level write operations are atomic?
A. Collection
B. Document
C. Field
D. Row
View Answer
Ans : B
Explanation: No single write operation can atomically affect more than one document or more than one collection.
3. ________ 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
Ans : D
Explanation: Applications can resolve these references to access the related data. Broadly, these are normalized data models.
4. The limit on the number of namespaces depend on the ?
A. <database>.ns size
B. <document>.ns size
C. <field>.ns size
D. <row>.ns size
View Answer
Ans : A
Explanation: The limit on the number of namespaces depend on the <database>.ns size.
5. The namespace file defaults to ?
A. 4 MB
B. 8 MB
C. 16 MB
D. 32 MB
View Answer
Ans : C
Explanation: MongoDB using the mmapv1 storage engine has limits on the number of namespace.The namespace file defaults to 16 MB.
6. _______index allows efficient retrieval of chunks using the files_id and n values.
A. repairDatabase
B. dataFS
C. fileFS
D. GridFS
View Answer
Ans : D
Explanation: GridFS index allows efficient retrieval of chunks using the files_id and n values.
7. How many does collections GridFS use to store files?
A. 1
B. 4
C. 3
D. 2
View Answer
Ans : D
Explanation: One collection stores the file chunks, and the other stores file metadata
8. Which of the following checks and repairs errors and inconsistencies in data storage?
A. repairDatabase
B. repairedDatabase
C. recoverDatabase
D. None of the above
View Answer
Ans : A
Explanation: repairDatabase is analogous to an fsck command for file systems.
9. GridFS is useful only for storing files that exceed 16MB
A. TRUE
B. FALSE
C. Can be true or false
D. Can not say
View Answer
Ans : B
Explanation: GridFS is useful not only for storing files that exceed 16MB but also for storing any files for which you want to access without having to load the entire file into memory.
10. The key consideration for the structure of your documents is the decision to embed or to use references
A. TRUE
B. FALSE
C. Can be true or false
D. Can not say
View Answer
Ans : A
Explanation: Effective data models support your application needs.
Discussion