This set of MongoDB Multiple Choice Questions & Answers (MCQs) focuses on “Read and Write Semantics”.
1. The __________ of a replica set affects the outcome of failover situations.
a) deployment
b) architecture
c) structure
d) all of the mentioned
View Answer
Explanation: To support effective failover, ensure that one facility can elect a primary if needed.
2. Point out the wrong statement.
a) Administrators must apply or discard rollback data manually
b) Network partitions could not prevent the set from being able to form a majority
c) Replica sets remove “rollback” data when needed without intervention
d) None of the mentioned
View Answer
Explanation: When a rollback does occur, it is often the result of a network partition.
3. A rollback reverts _______ operations on a former primary when the member rejoins the replica set after a failover.
a) read
b) write
c) view
d) secondary
View Answer
Explanation: The replica set recovers from the loss of a primary by holding an election.
4. A priority __ member is a secondary that cannot become primary.
a) 0
b) 1
c) 2
d) None of the mentioned
View Answer
Explanation: Priority 0 members cannot trigger elections.
5. Point out the correct statement.
a) Elections does not occur when the primary becomes unavailable and the replica set members autonomously select a new primary
b) A priority 1 member maintains a copy of the data set, accepts read operations, and votes in elections
c) In a two-member replica set, in one data center hosts the primary and a secondary.
d) None of the mentioned
View Answer
Explanation: Configure a priority 0 member to prevent secondaries from becoming primary, which is particularly useful in multi-data center deployments.
6. A second data center hosts one priority 0 member that cannot become ___________
a) primary
b) write
c) view
d) Secondary
View Answer
Explanation: A priority 0 member can function as a standby.
7. A ______ member maintains a copy of the primary’s data set but is invisible to client applications.
a) primary
b) delayed
c) hidden
d) none of the mentioned
View Answer
Explanation: Hidden members are good for workloads with different usage patterns from the other members in the replica set.
8. The db.________ method does not display hidden members.
a) isPrima ry()
b) isMaster()
c) Master()
d) none of the mentioned
View Answer
Explanation: Hidden members, however, may vote in elections.
9. In a sharded cluster _______ do not interact with hidden members.
a) mongod
b) mongos
c) mongostore
d) all of the mentioned
View Answer
Explanation: Clients will not distribute reads with the appropriate read preference to hidden members.
Sanfoundry Global Education & Learning Series – MongoDB.
Here’s the list of Best Books in MongoDB.
- Practice Programming MCQs
- Check MongoDB Books
- Check Information Technology Books
- Apply for Programming Internship