QuizzesLog Compaction — Concept Check
intermediate
kafka

Log Compaction — Concept Check

Questions on Log Compaction. Compacted topics retain only the latest value per key, acting as a change-log materialised view; deleted records are signalled with a null-value tombstone.

8 minutes 8 questions Pass at 70%
Time Limit
8 minutes - timer starts when you begin
Change Answers Freely
Revisit and change any answer before submitting
Full Review After Submit
Correct answers and explanations shown for every question
Auto-submit on timeout
Quiz submits automatically when time runs out

Questions in this quiz

8 questions on Log Compaction — Concept Check. Work through them here, then start the quiz to answer them and see your score.

  1. 1.A Kafka topic is configured with `cleanup.policy=compact`. What happens to a key-value pair after a tombstone is produced for that key?

    • AThe key is eventually removed from the topic.
    • BThe tombstone is ignored if the log is not full.
    • CThe key remains indefinitely in the topic.
    • DThe key is immediately removed from the topic.
  2. 2.A service using Kafka Streams KTable needs to ensure it always has the latest user profile data. How does log compaction help achieve this?

    • AIt requires manual intervention to update keys.
    • BIt deletes all old records immediately.
    • CIt retains the latest value for each key indefinitely.
    • DIt stores the complete history of changes.
  3. 3.A Kafka topic has `min.compaction.lag.ms` set to 60000. What does this configuration ensure?

    • ACompaction is delayed by 60 seconds after a tombstone is produced.
    • BCompaction occurs every 60 seconds.
    • CRecords remain in the head for at least 60 seconds before compaction.
    • DRecords are deleted 60 seconds after being compacted.
  4. 4.A Kafka consumer joins a compacted topic late. What state can it reconstruct by replaying the log from offset 0?

    • AOnly the keys that have tombstones.
    • BThe entire history of all changes.
    • CA snapshot of the state at the time of joining.
    • DThe current state with the latest value per key.
  5. 5.What is the role of a tombstone in a Kafka compacted topic?

    • AIndicates a key-value update.
    • BMarks the start of a new log segment.
    • CPrevents compaction of a key.
    • DSignals the deletion of a key.
  6. 6.Why might someone incorrectly believe that a compacted topic retains the full history of changes?

    • ABecause they confuse it with a time-based retention policy.
    • BBecause they think tombstones preserve history.
    • CBecause they believe Kafka always stores full logs.
    • DBecause they assume compaction stores all updates.
  7. 7.A Kafka topic is set with `min.cleanable.dirty.ratio=0.5`. What does this configuration imply?

    • ACompaction runs continuously at 50% efficiency.
    • BOnly 50% of records are compacted at a time.
    • CCompaction occurs every 50 milliseconds.
    • DAt least 50% of the log must be dirty before compaction triggers.
  8. 8.In a Kafka Streams application, why is a compacted topic used for KTables?

    • ATo ensure the latest value per key is always available.
    • BTo improve the speed of log segment deletion.
    • CTo store the full history of each key.
    • DTo reduce the number of partitions needed.