MongoDB MCQ Questions - Replication
This section focuses on "Replication" 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. What is true about Replication?
A. Replication is the process of synchronizing data across multiple servers.
B. Replication provides redundancy and increases data availability with multiple copies of data on different database servers.
C. Replication protects a database from the loss of a single server.
D. All of the above
View Answer
Ans : D
Explanation: All of the above statement are true.
2. Replication is not used for?
A. keep your data safe
B. Low availability of data
C. Disaster recovery
D. Read scaling
View Answer
Ans : B
Explanation: Replication provide High (24*7) availability of data.
3. Replica set is transparent to the application.
A. TRUE
B. FALSE
C. Can be true or false
D. Can not say
View Answer
Ans : A
Explanation: Yes, Replica set is transparent to the application.
4. A replica set is a group of ___________ instances that host the same data set.
A. cluster
B. failover
C. mongod
D. Consensus
View Answer
Ans : C
Explanation: A replica set is a group of mongod instances that host the same data set.
5. In a replica, one node is primary node that receives?
A. all write operations
B. all read operations
C. all read and write operation
D. None of the above
View Answer
Ans : B
Explanation: In a replica, one node is primary node that receives all write operations.
6. Which of the following is not a Replica Set Features?
A. Automatic failover
B. Automatic recovery
C. Consensus election of primary
D. A cluster of only one nodes
View Answer
Ans : D
Explanation: A cluster of only one nodes is not a Replica Set Features.
7. In MongoDB client, how to initiate a new replica set?
A. rs.initiate()
B. rs.conf()
C. rs.status()
D. None of the above
View Answer
Ans : A
Explanation: In Mongo client, issue the command rs.initiate() to initiate a new replica set
8. To check the replica set configuration, issue the command rs.conf().
A. TRUE
B. FALSE
C. Can be true or false
D. Can not say
View Answer
Ans : A
Explanation: To check the replica set configuration, issue the command rs.conf().
9. Which of the following is correct syntax to Add Members to Replica Set?
A. db.add(HOST_NAME:PORT)
B. rs.add(HOST_NAME:PORT)
C. rs.isMaster(HOST_NAME:PORT)
D. db.isMaster(HOST_NAME:PORT)
View Answer
Ans : B
Explanation: The basic syntax of rs.add() command is as follows : rs.add(HOST_NAME:PORT)
10. To check whether you are connected to primary or not, issue the command db.Master() in mongo client.
A. TRUE
B. FALSE
C. Can be true or false
D. Can not say
View Answer
Ans : B
Explanation: To check whether you are connected to primary or not, issue the command db.isMaster() in mongo client.
Discussion