Skip to main content

Module Quiz

Complete this quiz after finishing all concept and practice pages. Save your answers before opening separate quiz calibration.

Current Module Questions​

Question 1: Three Reasons to Replicate​

Name three distinct goals replication can serve, and for each, name a workload where that goal dominates.

Question 2: Partition-Key Choice​

You have 1 billion users. Why is range-partitioning by user_id likely a bad idea, and what are two better alternatives?

Question 3: CAP Under Partition​

A two-datacenter cluster using single-leader synchronous replication suffers a network partition between the DCs. The leader is in DC-A; a follower is in DC-B. Describe what happens to reads and writes in each DC under (a) CP configuration, (b) AP configuration.

Question 4: Replication Log Format​

Why can MySQL binlog_format=STATEMENT silently corrupt a replica when a statement contains NOW() or RAND()?

Question 5: Sync vs Async Durability​

Under async replication, the leader commits writes locally and returns success immediately. Under semi-sync with one required replica, the leader waits for one replica to ack before returning success. Quantify the data-loss window for each when the leader crashes.

Question 6: Read-Your-Writes Scenario​

A user posts a comment and refreshes the page; the comment is intermittently missing. Async replicas lag 200 ms. Name the anomaly and prescribe the minimum mechanism that fixes it.

Question 7: Quorum Choice​

A Cassandra cluster has N=5. For each (W, R), say whether reads see the latest write (assuming no failures) and whether the cluster tolerates one replica failure for both reads and writes:

  1. (W=3, R=3)
  2. (W=5, R=1)
  3. (W=1, R=1)
  4. (W=1, R=5)

Question 8: Secondary-Index Partitioning​

Given a users collection sharded by user_id, a query SELECT * FROM users WHERE email = ? requires a scatter-gather in MongoDB. Explain why, and describe what changes if the index is global (term-partitioned) instead.

Question 9: Hotspot Analysis​

A hash-partitioned social-feed database has 99 mostly-idle partitions and one partition at 95% CPU. Investigation shows the hot partition stores posts for a single celebrity account with 50M followers. Why doesn't adding more partitions fix this, and what does?

Question 10: Rebalancing Scheme​

Why is consistent hashing preferred over hash(key) mod N for a cluster where the node count changes over time?

Question 11: Failover Scenario (failure -> reads/writes)​

A Postgres cluster uses Patroni with an etcd cluster holding the "who is the leader" key as a TTL'd lock. The primary loses its network to etcd but remains reachable from some application clients. Describe what happens to reads and writes on the primary and on the promoted replica.

Question 12: Failover Scenario (split-brain risk)​

Describe a replication/failover setup where split-brain can occur, and name the mechanism that prevents it.

Question 13: Replication Log and Downstream Consumer​

An analytics pipeline wants to consume every change made to a Postgres database and ship it to a Kafka topic. Which replication log format supports this, and what mechanism does Postgres provide?

Question 14: Multi-Leader Conflict​

Two leaders each accept a write to the same row within 10 ms of each other. One leader's clock is ahead of the other by 100 ms due to NTP skew. Under last-writer-wins, what happens, and why is this dangerous?

Question 15: PostgreSQL / MongoDB / Cassandra Mapping​

For each replication concept, say how PostgreSQL, MongoDB, and Cassandra handle it:

  1. Replication topology.
  2. Failover mechanism.
  3. CAP choice under a network partition.

Interleaved Review Questions​

Prior Module Question 1 (S6 Module 2: Storage Engines)​

Why does a B-tree storage engine pair well with a WAL for durability, and what role does the WAL play in replication?

Prior Module Question 2 (S6 Module 1: SQL)​

If a sharded application queries SELECT COUNT(*) FROM orders WHERE status='shipped' without a partition-key filter, what happens at execution time?

Prior Module Question 3 (S5 Module 4: Networks)​

A database cluster assumes network round-trip time is bounded. Why is that assumption unsafe in a real data center, and what does "unbounded delay" mean operationally?

Prior Module Question 4 (S5 Module 3: OS -- Concurrency)​

In a leaderless replication system, two clients concurrently write different values to the same key. How does the database decide which value is the "latest," and what is the failure mode?

Prior Module Question 5 (S5 Module 5 / S6 Module 2: Distributed Time)​

Why is relying on synchronized clocks dangerous for distributed leases (e.g., "the leader holds the lock for 30 s")?

Self-Assessment and Remediation​

Mastery Level (90-100% correct):

  • Retrieval is strong; complete all module and semester evidence gates before advancing.

Proficient Level (75-89% correct):

  • Review missed concepts. Redo Practice 1 (topologies) or Practice 3 (anomalies clinic) depending on the gap.

Developing Level (60-74% correct):

  • Redo Practice 2 (partitioning workshop) end to end. Most gaps cluster around "pick a key and defend it."
  • Redo at least two Jepsen-style analyses (Practice 4 Kata 4).

Insufficient Level (<60% correct):

  • Restart with Clusters 1-2. The most common failure mode is pattern-matching topology names without internalizing the write and read paths. Draw every topology from memory before re-reading.
  • Spend a session on the CAP/PACELC scenario questions; these are the hinge of the module.

Progression boundary​

Quiz performance calibrates retrieval and reasoning. It does not replace runnable work, changed-case transfer, the module assessment or required semester evidence. Consult practice calibration for the additional independent cases.