QuizzesLog Retention & Compaction — Concept Check
intermediate
kafka

Log Retention & Compaction — Concept Check

Questions on Log Retention & Compaction. Kafka retains messages on disk regardless of consumer acknowledgement. Retention can be time-based, size-based, or compaction-based, giving full control over data lifetime.

7 minutes 7 questions Pass at 70%
Time Limit
7 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

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

  1. 1.A Kafka topic 'orders' has retention settings of retention.ms=86400000 and retention.bytes=1073741824. What happens when the topic size reaches the byte limit?

    • ANew messages are rejected until space is available.
    • BOldest log segments are deleted until the size is below the limit.
    • CMessages are deleted immediately as they arrive.
    • DRetention.ms setting is ignored until size is reduced.
  2. 2.A Kafka topic is configured with cleanup.policy=compact. What happens when a message with a null value is produced?

    • AThe key is marked for deletion.
    • BThe message is ignored.
    • CThe message is stored as is.
    • DThe topic is compacted immediately.
  3. 3.You notice that a Kafka topic is not reducing in size despite having a retention.ms of 1 day. What could be a reason?

    • AThe Kafka broker is down.
    • BThe retention.bytes is set to a very high value.
    • CThe retention.ms setting is ignored by Kafka.
    • DThe topic has cleanup.policy=compact set.
  4. 4.A topic 'user-profiles' is set with cleanup.policy=compact. What does this configuration imply?

    • AOnly the latest message for each key is retained.
    • BMessages are retained based on size only.
    • CMessages are retained for a fixed time only.
    • DAll messages are deleted after consumption.
  5. 5.A producer sends a null value for a key in a compacted topic. What is the result?

    • AThe entire topic is deleted.
    • BThe key is deleted during compaction.
    • CThe message is stored but ignored.
    • DThe key remains unchanged.
  6. 6.In Kafka, what triggers the deletion of old log segments when both time and size-based retention are configured?

    • ANeither limit triggers deletion.
    • BOnly the size-based limit.
    • CWhichever limit is reached first.
    • DOnly the time-based limit.
  7. 7.A Kafka topic has retention.bytes set to 1GB and retention.ms set to 7 days. What happens when the topic exceeds 1GB?

    • AOldest segments are deleted until size is below 1GB.
    • BMessages are compressed to fit under 1GB.
    • CNew messages are rejected.
    • DRetention.ms is reset to a higher value.