M102 WEEK 4 QUIZ

QUIZ QUESTIONS AND ANSWERS

Question: Why do we use replica sets? Check all that apply.

  1. High Availability (Ans)
  2. Durability (Ans)
  3. Scaling in some situations (Ans)
  4. Disaster Recovery (Ans)
  5. As main backup

Question: Which of the following are true about replication in MongoDB?

  1. Works on commodity hardware (Ans)
  2. Supports a model of replications with single primary and multiple secondaries (Ans)
  3. Also supports multi-master replication
  4. Works across wide-area networks (Ans)
  5. Provides eventual consistency (Ans)

Question: Imagine a replica set with 5 servers. What is the minimum number of servers (assume each server has 1 vote) to form a consensus?

  1. 2
  2. 3 (Ans)
  3. 4
  4. 5

Question: Which of the following scenarios can trigger a rollback?

  1. A secondary (that was previously a primary) contains write operations that are ahead of current primary (Ans)
  2. A secondary lags behind the primary by 2 hours or more
  3. A secondary lags behind the primary by 100 writes or more

Question: Why do we give replica sets names?

  1. There is no way for any system to implement replication without a name.
  2. Having a single name to refer to set reduces confusion and human error. (Ans)
  3. Replication sets are sentient, and deserve to receive names.
  4. Replication set members should all be hosted on a single box, and the name uniquely identifies that box.

Question: What does optimeDate represent?

  1. The servers time
  2. The time of the last operation (Ans)
  3. The time of the first operation
  4. The last heartbeat
    The time the status command was run

Question: Which command prevents a node from becoming primary for 5 minutes?

  1. rs.stepDown(300) (Ans)
  2. rs.isMaster(300)
  3. rs.slaveOk(300)
  4. rs.freeze(300) (Ans)
  5. rs.remove(300)

Question: When a primary goes down and then is brought back online, it will always resume primary status:

  • True
  • False (Ans)

Question: What are good reasons to read from a secondary? Check all that apply.

  1. Geographic reads (latency) (Ans)
  2. Separate a workload (analytics/reporting) (Ans)
  3. High availability (during fail over) (Ans)
  4. Primary is overloaded with writes and cann’t handle reads
  5. Require consistent reads

Question: For reads which must be consistent, which read preference(s) is used?

  1. Primary (Ans)
  2. Primary Preferred
  3. Secondary Preferred
  4. Secondary
  5. Nearest

 

Leave a Reply

Your email address will not be published. Required fields are marked *