Self-Assessment Quiz: Distributed Systems Foundations
Twenty questions. Aim for 16 or more. On the streaming path, treat 18 as the bar — Chapters 14, 15, and 29 assume all of this.
Question 1
The third outcome of a remote request, which does not exist on a single machine, is:
- A. The request fails with an error
- B. The request succeeds
- C. You cannot tell whether it executed
- D. The request is queued
Question 2
Why does an operation you might retry need a client-generated key?
- A. To improve performance
- B. So the server can recognize a resubmission of the same logical work
- C. To satisfy audit requirements
- D. To route the request to the correct partition
Question 3
Which partition key would be catastrophic for Kestrel's clickstream?
- A.
session_id - B.
event_type - C. A hash of
event_id - D.
session_idconcatenated with a salt
Question 4
A job finishes when its slowest task finishes. The implication for partitioning is:
- A. Average partition size determines cost
- B. Maximum partition size determines cost
- C. Partition count should equal node count
- D. Smaller partitions are always better
Question 5
A customer_id partition key has millions of distinct values but one B2B customer places 8% of
orders. This demonstrates that:
- A. Hash partitioning is unreliable
- B. High cardinality is not the same as even distribution
- C. Range partitioning would be better
- D. The partition count was too low
Question 6
Which is a reasonable default target size for a Parquet file in object storage?
- A. 1 MB
- B. 16 MB
- C. 256 MB
- D. 8 GB
Question 7
Three things commonly defeat partition pruning. Which is NOT one of them?
- A. A function applied to the partition column in the WHERE clause
- B. A type mismatch forcing a per-row cast
- C. A subquery in the partition predicate that cannot be pushed down
- D. Using a compressed file format
Question 8
Replication lag causes permanent row loss in a watermark-based extract because:
- A. The replica drops rows under load
- B. The watermark is recorded from the replica's view and rows arriving in the lag window fall below it
- C. Replicas apply writes out of order
- D. The extract times out during lag
Question 9
Which fix for the replication-lag watermark bug is exactly correct rather than defense in depth?
- A. Subtract a 15-minute safety margin
- B. Refuse to extract when lag exceeds a threshold
- C. Read the watermark from the primary
- D. Increase the extract frequency
Question 10
The quorum condition for guaranteeing a read sees the latest write is:
- A. $W + R > N$
- B. $W + R < N$
- C. $W = R = N$
- D. $W > R$
Question 11
The most common misreading of CAP is:
- A. That it applies only to relational databases
- B. That it is "pick two of three"
- C. That it was disproved
- D. That it applies only during network partitions
Question 12
PACELC's second clause says that in normal operation you choose between:
- A. Availability and consistency
- B. Latency and consistency
- C. Durability and throughput
- D. Partition tolerance and availability
Question 13
S3's consistency model:
- A. Is eventually consistent for overwrites
- B. Became strongly read-after-write consistent for all operations in 2020
- C. Requires a consistency layer such as EMRFS consistent view
- D. Depends on the region
Question 14
"Eventually consistent" promises convergence if writes stop. It does NOT promise:
- A. That replicas will agree
- B. When convergence happens, or that reads move forward in time
- C. That writes are durable
- D. That the system remains available
Question 15
Kafka's transactional producer provides exactly-once semantics:
- A. End to end, including writes to external databases
- B. From a Kafka topic through a stream processor to another Kafka topic
- C. Only for single-partition topics
- D. Only when combined with idempotent consumers
Question 16
The pattern this book uses throughout is:
- A. Exactly-once delivery
- B. At-most-once delivery with monitoring
- C. At-least-once delivery plus idempotent writes
- D. Two-phase commit across systems
Question 17
Which is NOT one of the four idempotent write strategies?
- A. Delete-insert
- B. Merge on a natural key
- C. Partition replacement
- D. Retry with exponential backoff
Question 18
For analytics, the right time basis is usually:
- A. Processing time, because it is always available
- B. Event time, because the business question is about when things happened
- C. Ingestion time, because it is monotonic
- D. Whichever the source system provides
Question 19
A watermark, in stream processing, is:
- A. A checksum on a batch of events
- B. A declaration that you no longer expect events older than a given event time
- C. The offset of the last processed message
- D. A per-partition sequence number
Question 20
Exponential backoff without jitter fails because:
- A. It retries too slowly
- B. It synchronizes the herd at a longer interval instead of spreading it
- C. It overflows the retry counter
- D. It cannot be combined with circuit breakers
Answer Key
1. C — §4.1. Retry and you may duplicate; do not and you may lose. There is no third option, and no engineering removes the uncertainty.
2. B — §4.1, 🏭 callout. The key identifies the logical work, not the attempt. Three concurrent Spark jobs ran because "submit a job" was treated as idempotent when it was not.
3. B — §4.2. Seven distinct values, and page_view dominates. Low cardinality plus natural
popularity is the classic skew generator.
4. B — §4.2. You pay for the maximum partition times the number of nodes waiting on it.
5. B — §4.2, ⚠️ callout. A key can have millions of values and still be dominated by a few. The 22-minute job became 71 minutes about once a week.
6. C — §4.2. 128 MB – 1 GB is the working range; 256 MB is a good default.
7. D — §4.2, 💸 callout. Compression is orthogonal to pruning. The three are a function on the partition column, a type mismatch, and an unpushable subquery — all written by careful engineers producing correct results.
8. B — §4.3, ⚠️ callout. Rows committed on the primary during the lag window arrive on the
replica with updated_at values below the stored watermark.
9. C — §4.3. Reading the watermark from the primary solves it exactly. The margin and the lag threshold are defense in depth, and Kestrel does all three because they do different jobs.
10. A — §4.3. With $N=3$, $W=R=2$ is the common default. $W=R=1$ gives fast operations and stale reads.
11. B — §4.4. Partition tolerance is not optional — networks partition whether you choose or not. The real choice is binary and applies only during a partition.
12. B — §4.4. And this is the choice you actually make every day, which is why PACELC is more useful than CAP.
13. B — §4.4, 🧭 Version Note. Pre-2021 advice about working around S3 eventual consistency is obsolete and still ranks well in search results.
14. B — §4.4. "Eventually" is unbounded, and reads may go backwards — a value can appear, disappear, and reappear.
15. B — §4.5. Real and well-engineered, and it is a claim about that hop. The write to Postgres or S3 sits outside the transaction boundary.
16. C — §4.5. At-least-once plus idempotent writes gives effectively-once processing, with any transport and any sink, and no distributed transaction coordinator.
17. D — §4.5. Backoff is a retry policy, not an idempotency strategy. The fourth is deduplicate-on-read.
18. B — §4.6. "What did customers do on Tuesday," not "what did our servers see on Tuesday." The cost is that you must handle late data.
19. B — §4.6. And what happens to later events is a stated policy — dropped, side-outputted, or triggering recomputation. It is a business decision in technical clothes.
20. B — §4.7. Without randomization, backoff merely re-synchronizes the herd. The jitter is the part people omit.
Topic map
| Missed | Reread |
|---|---|
| 1, 2 | §4.1 — partial failure |
| 3, 4, 5, 6, 7 | §4.2 — partitioning and skew |
| 8, 9, 10 | §4.3 — replication and lag |
| 11, 12, 13, 14 | §4.4 — consistency, CAP, PACELC |
| 15, 16, 17 | §4.5 — delivery semantics |
| 18, 19 | §4.6 — time and ordering |
| 20 | §4.7 — the failure modes |