[{"id":"kafkaintermediate-001","courseId":"kafka-intermediate","domain":"log-and-storage","topic":"Tiered storage quick start","prompt":"A tester follows the Tiered Storage quick start to check that old data is served from remote storage. Put these steps in the order the guide runs them.","hint":"Think about what must happen before old data can leave local disk, and which step reads it back.","explain":"With tiered storage, a topic keeps recent segments on local disk and completed segments in a remote store. Local retention is set separately, and reads of old offsets can be served from either tier.","source":"https://kafka.apache.org/43/operations/tiered-storage/","interaction":{"type":"sort","items":[{"text":"Create the topic with remote.storage.enable=true and a short local.retention.ms","why":"Tiered storage is switched on per topic, so the topic must be configured before any segment can move to remote storage."},{"text":"Send 1200 records of 1 KB with the producer perf test to roll the active segment","why":"With segment.bytes at 1 MiB, that much data rolls the active segment, leaving a finished segment to move."},{"text":"The rolled segment moves to remote storage and is deleted from local disk","why":"The guide says the old segment should be moved to remote storage and deleted locally, and you can check the remote log directory."},{"text":"Consume from the beginning to fetch offset 0 from remote storage","why":"Reading from the start reaches data that is now stored remotely, which confirms the remote tier serves old offsets."}]},"options":[],"answer":"o:abcd","explanation":"The Tiered Storage quick start creates the topic with remote storage on, produces enough data to roll a segment, moves the old segment to remote storage and deletes it locally, then reads offset 0 back from the remote tier.","concept":"The Tiered Storage quick start creates the topic with remote storage on, produces enough data to roll a segment, moves the old segment to remote storage and deletes it locally, then reads offset 0 back from the remote tier.","rev":1,"updatedAt":"2026-10-23","kind":"scenario","takeaways":["Once a rolled segment has moved to remote storage, reads from the start are served from the remote tier."]},{"id":"kafkaintermediate-002","courseId":"kafka-intermediate","domain":"log-and-storage","topic":"Time retention by segment timestamp","prompt":"Time-based retention is enabled. A segment file holds records with timestamps 09:00, 14:00 and 11:30, written in that order. Which timestamp decides when the whole segment is eligible for deletion?","hint":"Think about one value that represents the whole file, not a single record.","explain":"Retention is applied to whole segment files, not to single records. Each record has its own timestamp, so a rule is needed to turn all of a file's timestamps into one retention time.","source":"https://kafka.apache.org/43/implementation/log/#deletes","interaction":{"type":"single"},"options":[{"id":"a","text":"The timestamp of the first record written, 09:00","whyNot":"Only one timestamp counts for the segment, and it is not the earliest record's."},{"id":"b","text":"The timestamp of the last record written, 11:30","whyNot":"Record order inside a segment does not matter, so the most recently written record is not used."},{"id":"c","text":"The largest timestamp in the segment, 14:00","why":"The largest timestamp in a segment file defines the retention time for the entire segment."},{"id":"d","text":"The average of the three timestamps","whyNot":"Kafka does not average timestamps; the largest one in the segment sets the retention time."}],"answer":"c","explanation":"For time-based retention, the largest record timestamp in a segment file sets the retention time for the whole segment, regardless of record order.","concept":"For time-based retention, the largest record timestamp in a segment file sets the retention time for the whole segment, regardless of record order.","rev":1,"updatedAt":"2026-10-23","kind":"scenario","takeaways":["One record with a late timestamp keeps its whole segment alive under time retention."]},{"id":"kafkaintermediate-003","courseId":"kafka-intermediate","domain":"log-and-storage","topic":"Dual retention policies","prompt":"When a topic has both time and size retention enabled, a segment is deleted only when it is older than the time limit and the partition is also over its size limit.","hint":"Consider how the two rules combine when a segment meets just one of them.","explain":"Retention can be limited by time, by size, or by both. The log manager checks the enabled rules against segment files and removes whole segments, one at a time, when a rule makes them eligible.","source":"https://kafka.apache.org/43/implementation/log/#deletes","interaction":{"type":"true-false"},"options":[{"id":"a","text":"True","whyNot":"Enabling both policies makes a segment eligible if either one applies, so meeting only the time limit is enough."},{"id":"b","text":"False","why":"A segment that is eligible under either policy is deleted, so both limits do not need to be exceeded."}],"answer":"b","explanation":"When both time and size retention are enabled, a segment that is eligible under either policy is deleted.","concept":"When both time and size retention are enabled, a segment that is eligible under either policy is deleted.","rev":1,"updatedAt":"2026-10-23","kind":"scenario","takeaways":["Multiple retention rules combine with OR: any one that applies deletes the segment."]},{"id":"kafkaintermediate-004","courseId":"kafka-intermediate","domain":"log-and-storage","topic":"preallocate","prompt":"A new topic is created with no config overrides. In Apache Kafka 4.3, what is the default value of the preallocate topic config, which controls whether a new segment file is reserved on disk when created?","hint":"Find the topic setting that governs whether a new segment file reserves disk space, and check its default.","explain":"Each partition's log is stored as segment files. A topic setting decides whether a new segment file's disk space is reserved at creation. Other segment settings control when a new segment starts.","source":"https://kafka.apache.org/43/configuration/topic-configs/#topicconfigs_preallocate","interaction":{"type":"single"},"options":[{"id":"a","text":"true","whyNot":"Setting it to true reserves each new segment file on disk, but true is not the default."},{"id":"b","text":"false","why":"The default is false, so new segment files are not preallocated unless a topic turns the setting on."},{"id":"c","text":"1073741824 (1 GiB)","whyNot":"That is the default segment.bytes, the size at which a segment rolls over, not a preallocation default."},{"id":"d","text":"604800000 (7 days)","whyNot":"That is the default segment.ms, the time after which the log rolls, not a preallocation default."}],"answer":"b","explanation":"The preallocate topic config is a boolean that defaults to false; when true, a new log segment file is preallocated on disk when it is created.","concept":"The preallocate topic config is a boolean that defaults to false; when true, a new log segment file is preallocated on disk when it is created.","rev":1,"updatedAt":"2026-10-23","kind":"scenario","takeaways":["The preallocate topic config defaults to false, so new segment files are not reserved up front."]},{"id":"kafkaintermediate-005","courseId":"kafka-intermediate","domain":"log-and-storage","topic":"Record batch checksum","prompt":"Which TWO statements about the CRC of a record batch in the current format (magic 2) are correct?","hint":"Check which bytes come before and after the CRC field, and what the checksum covers.","explain":"Every record batch carries a checksum so readers can detect corruption. Where the checksum sits in the header, and which fields it covers, decides how a reader must parse the bytes.","source":"https://kafka.apache.org/43/implementation/message-format/#record-batch","interaction":{"type":"multiple","tellCount":true},"options":[{"id":"a","text":"It covers every byte from the attributes field to the end of the batch.","why":"The CRC covers all the bytes that follow it, starting at attributes, so it includes the record count and records."},{"id":"b","text":"It covers baseOffset and batchLength, so offset changes are caught.","whyNot":"Those fields come before the CRC field and are not covered by it."},{"id":"c","text":"It uses the standard CRC-32 polynomial.","whyNot":"The batch CRC uses the CRC-32C (Castagnoli) polynomial instead."},{"id":"d","text":"The partition leader epoch is excluded, so it can be assigned without recomputing the CRC.","why":"That field is left out of the CRC so brokers can set it on each batch without recomputing the checksum."},{"id":"e","text":"It sits before the magic byte, so readers can check it first.","whyNot":"The CRC is located after the magic byte, so clients must parse the magic byte first."},{"id":"f","text":"It covers only the record payloads, not the batch header fields.","whyNot":"The CRC covers everything from attributes to the end of the batch, including the header fields after its position."}],"answer":"ad","explanation":"The batch CRC-32C covers the bytes from attributes to the end of the batch; it follows the magic byte, and the partition leader epoch is excluded so it can be set without recomputing the CRC.","concept":"The batch CRC-32C covers the bytes from attributes to the end of the batch; it follows the magic byte, and the partition leader epoch is excluded so it can be set without recomputing the CRC.","rev":1,"updatedAt":"2026-10-23","kind":"scenario","takeaways":["The batch CRC covers attributes through the end; the leader epoch field is excluded."]}]