Page Layout Checkpoint

Trace payload and descriptor bytes, preserve slot identity, and distinguish holes from insertion capacity.


Get every question correct to pass this checkpoint. You can review feedback, revise your answers, and submit again.

1. A 48-byte page has no on-page header and four-byte slots. After inserting records of lengths 8, 5, and 7, what is FreeSpace()? Enter one decimal integer.
2. On that 48-byte page (record lengths 8, 5, 7), delete slot 1 without compaction. What is FreeSpace()? Enter one decimal integer.
3. Compact that page after deleting slot 1. What byte offset now holds slot 2's seven-byte record? Enter one decimal integer.
4. After that compaction, 21 contiguous bytes remain. Which is the largest new payload that fits with its new four-byte slot?

Select one answer.

5. A compactor packs records correctly but renumbers live slots after deleting slot 1. What breaks?

Select one answer.

6. A 48-byte page has allocated three slots. Delete every record and compact. How much FreeSpace() remains under the no-slot-reuse policy? Enter one decimal integer.
7. Get(0) succeeds. A caller changes byte 0 of the returned slice, then calls Get(0) again. What should happen?

Select one answer.

8. An insertion needs one byte more than the contiguous gap. Which behavior matches the contract?

Select one answer.

Join Discord