Explore topic-wise MCQs in Mongodb.

This section includes 58 Mcqs, each offering curated multiple-choice questions to sharpen your Mongodb knowledge and support exam preparation. Choose a topic below to get started.

1.

Secondaries apply operations from the primary asynchronously to provide __________ consistency.

A. strict
B. strong
C. eventual
D. none of the mentioned
Answer» D. none of the mentioned
2.

For a member to sync from another, both members must have the same value for the _________ setting.

A. buildIndexes
B. getIndexes
C. buildpriIndexes
D. secondary
Answer» B. getIndexes
3.

Replication _______ is a delay between operation on the primary and the application of that operation from the oplog to the secondary.

A. lag
B. delay
C. latency
D. none of the mentioned
Answer» B. delay
4.

MongoDB writes the rollback data to BSON files in the rollback/ folder under the database’s ________ directory.

A. dbPath
B. logPath
C. dataPath
D. all of the mentioned
Answer» B. logPath
5.

The oplog must translate multi-updates into individual operations in order to maintain ____________

A. availability
B. idempotency
C. scalability
D. secondary
Answer» C. scalability
6.

Use _________ from a secondary member and the replication status output to assess the current state of replication.

A. db.getReplInfo()
B. db.getReplicationInfo()
C. rs.printReplicationInfo()
D. none of the mentioned
Answer» C. rs.printReplicationInfo()
7.

When ______________ is true, the mongod instance saves all documents migrated from the shard to the moveChunk directory of the storage.dbPath.

A. sharding.archiveChunks
B. sharding.archiveMovedChunks
C. shards.archiveMovedChunks
D. rs.syncFrom()
Answer» C. shards.archiveMovedChunks
8.

You can use the ________ setting in Replica Set Configuration to disable chained replication for situations where chained replication is causing lag.

A. chainingAllowed
B. chainingDisAllowed
C. chainingAllow
D. none of the mentioned
Answer» B. chainingDisAllowed
9.

You also can force a member never to become primary by setting its priority value to ___________

A. 1
B. 2
C. 3
D. 0
Answer» E.
10.

To finish the rolling maintenance operation, step down the primary with the _________ method.

A. rs.syncFrom()
B. rs.stepDown()
C. rs.synchrepl()
D. secondary
Answer» C. rs.synchrepl()
11.

Before mongod creates an oplog, you can specify its size with the __________ option.

A. oplogSizeMB
B. oplogSizeGB
C. opSizeMB
D. all of the mentioned
Answer» B. oplogSizeGB
12.

rs.reconfig() provides a wrapper around the ___________ command.

A. replSetfinalReconfig
B. replSetReconfig
C. replSetReconfiguration
D. none of the mentioned
Answer» C. replSetReconfiguration
13.

________ sets the slaveOk property for the current connection.

A. rs.reconfig()
B. rs.slaveOk()
C. rs.stepDown()
D. rs.slave()
Answer» C. rs.stepDown()
14.

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
Answer» D. none of the mentioned
15.

A second data center hosts one priority 0 member that cannot become ___________

A. primary
B. write
C. view
D. Secondary
Answer» B. write
16.

Which of the following members should be hidden?

A. Delayed
B. Hidden
C. Primary
D. All of the mentioned
Answer» B. Hidden
17.

A delayed member has its priority equal to 0 and hidden equal to ___________

A. 0
B. flase
C. true
D. all of the mentioned
Answer» D. all of the mentioned
18.

The standard replica set deployment for production system is a ___-member replica set.

A. two
B. three
C. four
D. five
Answer» C. four
19.

_________ for a replica set is the number of members that can become unavailable and still leave enough members in the set to elect a primary.

A. Fault tolerance
B. Reliability
C. Security
D. None of the mentioned
Answer» B. Reliability
20.

_________ member is used to support dedicated functions, such as backup or reporting.

A. Hidden
B. Primary
C. ViewState
D. None of the mentioned
Answer» B. Primary
21.

To protect your data if your main data center fails, keep at least _______ member in an alternate data center.

A. one
B. two
C. three
D. none of the mentioned
Answer» B. two
22.

Without a primary, a replica set cannot accept ________ operations.

A. read
B. write
C. read write
D. all of the mentioned
Answer» C. read write
23.

_________ sets also allow the routing of read operations to specific machines.

A. Field
B. Read
C. Tag
D. All of the mentioned
Answer» D. All of the mentioned
24.

What should be the priority of member to prevent them from becoming primary?

A. 0
B. 1
C. 2
D. 3
Answer» B. 1
25.

During initial sync, mongod will remove the content of the _______

A. dbPathSync
B. Path
C. dbPath
D. none of the mentioned
Answer» D. none of the mentioned
26.

In sharded clusters, delayed members have limited utility when the __________ is enabled.

A. Balancer
B. Collector
C. Emitter
D. None of the mentioned
Answer» B. Collector
27.

mongorestore recreates indexes recorded by _____________

A. bsondump
B. mongodump
C. mongostore
D. all of the mentioned
Answer» C. mongostore
28.

Delayed members are a ________ or a running “historical” snapshot of the data set.

A. “rolling backup”
B. “roll backup”
C. “rolling commit”
D. none of the mentioned
Answer» B. “roll backup”
29.

_________ is used to read the contents of the rollback files.

A. bsondumpdata
B. bsondp
C. bsondump
D. none of the mentioned
Answer» D. none of the mentioned
30.

By default, an application directs its ____ operations to the primary member.

A. read
B. write
C. read write
D. all of the mentioned
Answer» B. write
31.

How many types of members exist in replica set?

A. 1
B. 2
C. 3
D. 4
Answer» C. 3
32.

_________ play a role in the elections that select a primary if the current primary is unavailable.

A. Arbiters
B. Replicators
C. Loggers
D. None of the mentioned
Answer» B. Replicators
33.

Which of the member receives all write operations?

A. center
B. secondary
C. primary
D. none of the mentioned
Answer» D. none of the mentioned
34.

If the current primary becomes unavailable, the replica set holds an ______ to choose which of the secondaries becomes the new primary.

A. election
B. replication
C. clasification
D. none of the mentioned
Answer» B. replication
35.

Which of the following may be non-voting or priority 0?

A. center
B. secondary
C. primary
D. none of the mentioned
Answer» C. primary
36.

__________ explicitly override the default logic for selecting a member to replicate from.

A. replSetSyncFrom
B. resync
C. applyOps
D. isMaster
Answer» B. resync
37.

_______ is an internal command that applies oplog entries to the current data set.

A. replSetSyncFrom
B. resync
C. applyOps
D. isMaster
Answer» D. isMaster
38.

The architecture of a replica set affects the set’s _________ and capability.

A. scalability
B. capacity
C. performance
D. all of the mentioned
Answer» C. performance
39.

Which of the command is for master-slave replication only?

A. replSetSyncFrom
B. resync
C. applyOps
D. isMaster
Answer» C. applyOps
40.

__________ sets the member that this replica set member will sync from, overriding the default sync target selection logic.

A. rs.reconfig()
B. rs.remove()
C. rs.stepDown()
D. rs.syncFrom()
Answer» E.
41.

For most replica sets, the hostnames in the _________ field never change.

A. tag
B. host
C. rs
D. none of the mentioned
Answer» C. rs
42.

Delayed members apply operations from the _______ on a delay.

A. oplog
B. log
C. mlog
D. none of the mentioned
Answer» B. log
43.

The names of rollback files have the following form.

A. <database>.<collection>.<timestamp>.bson.
B. <database>.<collection>.<tp>.bson.
C. <database>.<collection>.<timestamp>.json.
D. None of the mentioned
Answer» B. <database>.<collection>.<tp>.bson.
44.

A delayed member may show as 0 seconds behind the primary when the inactivity period on the primary is greater than the ________ value.

A. slaveDelayTime
B. slaveDelay
C. slaveTime
D. rs.slave()
Answer» C. slaveTime
45.

The db.________ method does not display hidden members.

A. isPrima ry()
B. isMaster()
C. Master()
D. none of the mentioned
Answer» C. Master()
46.

In a sharded cluster _______ do not interact with hidden members.

A. mongod
B. mongos
C. mongostore
D. all of the mentioned
Answer» C. mongostore
47.

Use ______ to apply the changes to the new primary after rollback.

A. mongostore
B. mongorestore
C. restore
D. none of the mentioned
Answer» C. restore
48.

Which of the following ddds an arbiter to a replica set?

A. rs.addArb()
B. rs.addArbiter()
C. rs.addtoArb()
D. all of the mentioned
Answer» B. rs.addArbiter()
49.

A replica set can have up to ______ members but only 7 voting members.

A. 10
B. 30
C. 50
D. 70
Answer» E.
50.

__________ prints a report of the status of the replica set from the perspective of the secondaries.

A. rs.printSlaveReplicationInfo()
B. rs.printReplication()
C. rs.help()
D. none of the mentioned
Answer» B. rs.printReplication()