0
0
MongoDBquery~20 mins

Automatic failover behavior in MongoDB - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
MongoDB Failover Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
What triggers automatic failover in MongoDB replica sets?

In a MongoDB replica set, what event causes the automatic failover process to start?

AWhen a secondary node finishes syncing data
BWhen the primary node becomes unreachable or stops responding
CWhen a client disconnects from the database
DWhen the replica set configuration is changed manually
Attempts:
2 left
💡 Hint

Think about what happens if the main server stops working.

query_result
intermediate
1:30remaining
Result of election after primary failure

Given a MongoDB replica set with 3 members: one primary and two secondaries, if the primary goes down, what will be the state of the replica set after automatic failover?

AThe replica set becomes unavailable until manual intervention
BAll members become secondary
CThe original primary remains primary despite being down
DOne of the secondaries becomes the new primary, and the other remains secondary
Attempts:
2 left
💡 Hint

Think about how MongoDB keeps the database available after failure.

📝 Syntax
advanced
1:30remaining
Identify the correct command to check replica set status

Which MongoDB shell command correctly shows the current status of the replica set, including primary and secondaries?

Ashow replSet
Bdb.replicaSetStatus()
Crs.status()
Drs.showStatus()
Attempts:
2 left
💡 Hint

It is a method of the rs object.

optimization
advanced
2:00remaining
Optimizing failover time in MongoDB replica sets

Which configuration change can reduce the time it takes for automatic failover to complete in a MongoDB replica set?

ADecrease the electionTimeoutMillis setting
BDisable write concern majority
CIncrease the heartbeatIntervalMillis setting
DIncrease the priority of secondary nodes to zero
Attempts:
2 left
💡 Hint

Failover speed depends on how quickly nodes detect primary failure.

🔧 Debug
expert
2:30remaining
Diagnosing failover failure in MongoDB replica set

A MongoDB replica set does not perform automatic failover when the primary node goes down. Which of the following is the most likely cause?

AThe majority of voting members are not available to elect a new primary
BThe replica set has more than 3 members
CThe heartbeatIntervalMillis is set too low
DThe primary node has a higher priority than secondaries
Attempts:
2 left
💡 Hint

Think about what is needed for an election to succeed.