core practice · coding problem

B-tree page split

Page holds 4 keys, insert 5th triggers split. After split how many keys in each page (order 5)?

The mechanism

A B-tree is a wide, shallow tree sized to disk pages: each node holds many keys so the tree stays ~3-4 levels deep even for billions of rows. Reads are fast and in-place; writes do random page updates.

Study B-Tree

Expected evidence

2 keys in left, 2 in right, median promoted.

Try this drill in the practice workspace →

Hints when you need them
  • Split keeps tree balanced.
  • Fanout controls height.

Watch for these mistakes

  • Confusing B-tree (in-place, read-optimized) with LSM (append, write-optimized)
  • Ignoring page splits and write amplification
  • Forgetting that B-trees keep keys sorted, enabling range scans

Check the sources

Browse all practice briefs