MongoDB replication is a critical feature that ensures high availability and data redundancy. It involves maintaining multiple copies of data across different servers, known as replica sets. A replica set consists of a primary node (which handles all write operations) and secondary nodes (which replicate data from the primary). Replication helps in fault tolerance, load balancing, and disaster recovery.
This topic is frequently tested in interviews for roles involving database management and backend development. The following MCQs will help you prepare for such interviews by testing your knowledge of MongoDB replication concepts, configuration, and best practices.
1.) What is the primary purpose of replication in MongoDB?
2.) What is a replica set in MongoDB?
3.) How many nodes are required to form a replica set in MongoDB?
4.) Which node in a replica set handles all write operations?
5.) What is the role of an arbiter in a replica set?
6.) What happens if the primary node fails in a replica set?
7.) Which command is used to initiate a replica set in MongoDB?
8.) What is the maximum number of voting members allowed in a replica set?
9.) Which of the following is true about secondary nodes?
10.) What is the purpose of the oplog in MongoDB replication?