Self-Assessment Quiz: Event Streaming with Apache Kafka

Twenty questions. Aim for 16 or more. On the streaming path, treat 18 as the bar.


Question 1

A Kafka topic is, as a data structure:

  • A. A queue
  • B. An append-only log, partitioned, read by position, not consumed by reading
  • C. A key-value store
  • D. A distributed hash table

Question 2

Which property does a queue NOT have?

  • A. Ordering
  • B. Durability
  • C. Replay
  • D. Delivery

Question 3

The partition key does three jobs at once. Which is NOT one of them?

  • A. Determines ordering — same key, same partition
  • B. Spreads load across partitions
  • C. Determines retention
  • D. Determines skew

Question 4

A null key:

  • A. Fails the produce
  • B. Round-robins, maximizing distribution and giving up ordering entirely
  • C. Uses partition 0
  • D. Uses the message timestamp

Question 5

Increasing a topic's partition count:

  • A. Is a free capacity change
  • B. Breaks per-key ordering across the change, permanently, for straddling messages
  • C. Rewrites existing messages
  • D. Requires a full consumer restart only

Question 6

acks=all without min.insync.replicas set can degrade to:

  • A. acks=0
  • B. acks=1, when the in-sync set falls to one replica
  • C. No acknowledgment at all
  • D. It cannot degrade

Question 7

The most common producer bug is:

  • A. Wrong serialization
  • B. No delivery callback, so failures are silently dropped
  • C. Too large a batch size
  • D. Missing compression

Question 8

enable.auto.commit=True:

  • A. Is safe and recommended
  • B. Commits on a timer with no knowledge of whether processing succeeded — silently at-most-once
  • C. Commits only after a successful poll
  • D. Is required for consumer groups

Question 9

Which liveness mechanism causes most rebalance problems?

  • A. session.timeout.ms — the background heartbeat
  • B. max.poll.interval.ms — the poll loop
  • C. heartbeat.interval.ms
  • D. connections.max.idle.ms

Question 10

A rebalance storm is self-sustaining because:

  • A. Kafka retries indefinitely
  • B. Reassignment gives the surviving consumers more work, so they also exceed the interval
  • C. Offsets are lost
  • D. The coordinator fails over

Question 11

The first fix to try for a rebalance storm is:

  • A. Add consumers
  • B. Raise max.poll.interval.ms
  • C. Reduce max.poll.records
  • D. Increase partition count

Question 12

Which does NOT help a rebalance storm caused by per-batch slowness?

  • A. Reducing max.poll.records
  • B. Processing asynchronously with pause/resume
  • C. Adding consumers
  • D. Raising max.poll.interval.ms

Question 13

group.instance.id enables static membership, which:

  • A. Prevents all rebalances
  • B. Lets a consumer restarting within the session timeout rejoin with its existing assignment
  • C. Pins partitions permanently
  • D. Disables the group coordinator

Question 14

Compaction keeps:

  • A. Messages for a time limit
  • B. The most recent message per key, forever
  • C. All messages
  • D. Only messages with non-null keys

Question 15

What makes a compacted topic reconstructible into a table?

  • A. Its ordering
  • B. Replaying from the beginning gives the current state of every key
  • C. Its replication factor
  • D. Its retention

Question 16

Retention is described primarily as:

  • A. A cost decision
  • B. A recovery-window decision — how long a consumer can be broken before recovery gets harder
  • C. A compliance decision
  • D. A performance decision

Question 17

The idempotency key Kestrel's bronze writer uses is:

  • A. The event id
  • B. The session id
  • C. (topic, partition, offset) — unique by construction
  • D. A content hash

Question 18

Little's Law gave 8.7 handlers and the multipliers suggested 26. The topic has 12 because:

  • A. The arithmetic was wrong
  • B. The consumer parallelizes internally, 12 has convenient divisors, and the peak lasts minutes
  • C. 26 partitions exceeded broker limits
  • D. Ordering required fewer partitions

Question 19

Among crash, skip, and dead-letter, the chapter recommends:

  • A. Crash — it is loud
  • B. Skip — it maintains throughput
  • C. Dead-letter, and only if someone reads it
  • D. It depends on the message

Question 20

A DLQ's retention should be:

  • A. Shorter than the source topic's
  • B. The same as the source topic's
  • C. Longer than the source topic's — its contents are what you have not dealt with yet
  • D. Unlimited

Answer Key

1. B — §15.1. Everything else in the chapter is a consequence.

2. C — §15.1. Reading removes the message, so a bug is unrecoverable and a new consumer cannot read history. Replay alone justifies Kafka for most data engineering.

3. C — §15.2. Retention is a topic setting, unrelated to the key.

4. B — §15.2. Appropriate for metrics; wrong for anything with a per-entity sequence.

5. B — §15.2. It is a decision with an ordering consequence, not a capacity knob.

6. B — §15.3. acks=all with an in-sync set of one is acks=1 wearing a different name. Set the minimum explicitly.

7. B — §15.3. produce() returns before the message is sent; the symptom is missing data with no error anywhere.

8. B — §15.4. And it is the default.

9. B — §15.5. Your process is alive and heartbeating; it is simply slow.

10. B — §15.5. The system's response to slowness makes it slower, and it does not recover on its own.

11. C — §15.5. The fastest fix and usually sufficient.

12. C — §15.5. More consumers each still take too long, and you have added rebalance churn.

13. B — §15.5. Removes deploy-time churn for one line of configuration.

14. B — §15.6.

15. B — §15.6. Which is why CDC topics are compacted, and why the tombstone matters.

16. B — §15.6, 💸 callout. The same question as max_slot_wal_keep_size and vacuum retention, in three different systems.

17. C — §15.7. Unique by construction and requires no cooperation from the payload.

18. B — §15.8. The arithmetic gives you a floor and a shape, not an answer.

19. C — §15.10. Crash stops everything after the bad message; skip is silent data loss.

20. C — §15.10, ⚠️ callout. The reverse — the default — is how 8 months of diverted messages aged out.


Topic map

Missed Reread
1, 2 §15.1 — Kafka as a data structure
3, 4, 5 §15.2 — topics, partitions, keys
6, 7 §15.3 — producers
8 §15.4 — consumers and commits
9, 10, 11, 12, 13 §15.5 — rebalancing
14, 15, 16 §15.6 — retention and compaction
17 §15.7 — delivery semantics
18 §15.8 — sizing
19, 20 §15.10 — dead letter queues