codejump

System Design Expert — Series 3

Preview — 3 of 10 questions

Two shards each report their local top item by purchase count. Shard 1 has A=100, X=60; shard 2 has B=100, X=60. Can merging only local winners find the globally most purchased item?

AYes; choose A or B because both have a local count of 100.
BNo; exact global ranking is impossible even with all shard counts.
CYes; the maximum local count must be the maximum global count.
DNo; X totals 120 but is absent from both local winner lists.

Ownership of a key range moves from shard A to B while clients may have stale routing. What prevents both shards accepting independent authoritative writes?

AUpdate the router and trust every client's DNS TTL to expire before its next write.
BPick the value with the latest wall-clock timestamp after every conflicting write.
CCopy all rows to B and allow both shards to accept writes until traffic settles.
DEnforce an ownership epoch at the write boundary and transfer at a defined log position.

A consistent source snapshot is associated with log position P. The recovery protocol deliberately replays some changes already reflected in the snapshot. What must the destination support?

AIdempotent or version-aware application of overlapping changes.
BReplacing the snapshot with the consumer's current offset number.
CBlindly adding every replayed numeric delta to the snapshot value.
DDiscarding all changes until the first wall-clock midnight after P.

Sign up free to play

Answer all 10 questions (7 more), see explanations for every answer, and track your score.