MongoDB Questions and Answers – Big data and MongoDB

This set of MongoDB Multiple Choice Questions & Answers (MCQs) focuses on “Big data and MongoDB”.

1. MongoDB provides high ____________ with replica sets.
a) performance
b) availability
c) scalability
d) none of the mentioned
View Answer

Answer: b
Explanation: A replica set consists of two or more copies of the data.

2. Point out the correct statement.
a) MongoDB cannot be used as a file system
b) MongoDB can run over single servers only
c) Embedded documents and arrays reduce need for joins
d) None of the mentioned
View Answer

Answer: c
Explanation: MongoDB can run over multiple servers, balancing the load and/or duplicating data to keep the system up and running in case of hardware failure.

3. ___________ replicas maintain a copy of the data on the primary using built-in replication.
a) Primary
b) Secondary
c) Backup
d) All of the mentioned
View Answer

Answer: b
Explanation: When a primary replica fails, the replica set automatically conducts an election process to determine which secondary should become the primary.

4. MongoDB scales horizontally using _________ for load balancing purpose.
a) Replication
b) Partitioning
c) Sharding
d) None of the mentioned
View Answer

Answer: c
Explanation: The user chooses a shard key, which determines how the data in a collection will be distributed.

advertisement
advertisement

5. Point out the wrong statement.
a) Each replica set member will act in the role of primary replica only
b) The primary replica performs all writes and reads by default
c) Secondaries can also perform read operations, but the data is eventually consistent by default
d) None of the mentioned
View Answer

Answer: a
Explanation: Each replica set member may act in the role of the primary or secondary replica at any time.

6. MongoDB can be used as a ____________ taking advantage of load balancing and data replication features over multiple machines for storing files.
a) AMS
b) CMS
c) File system
d) None of the mentioned
View Answer

Answer: a
Explanation: The data is split into ranges (based on the shard key) and distributed across multiple shards.

Note: Join free Sanfoundry classes at Telegram or Youtube

7. _____________ can be used for batch processing of data and aggregation operations.
a) Hive
b) MapReduce
c) Oozie
d) None of the mentioned
View Answer

Answer: b
Explanation: The aggregation framework enables users to obtain the kind of results for which the SQL GROUP BY clause is used.

8. MongoDB supports fixed-size collections called ____________ collections.
a) primary
b) secondary
c) capped
d) all of the mentioned
View Answer

Answer: c
Explanation: This type of collection maintains insertion order and, once the specified size has been reached, behaves like a circular queue.

advertisement

9. MongoDB uses a ____________ lock that allows concurrent read access to a database but exclusive write access to a single write operation.
a) readers
b) readers-writer
c) writer
d) none of the mentioned
View Answer

Answer: b
Explanation: Before version 2.2, this lock was implemented on a per-mongod basis. Since version 2.2, the lock has been implemented at the database level.

10. Which of the following sorting is not supported by MongoDB?
a) collation
b) collection
c) heap
d) none of the mentioned
View Answer

Answer: a
Explanation: MongoDB does not support collation-based sorting and is limited to byte-wise comparison via memcmp.

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.