CS FundamentalsModerateProduct-company MCQ pattern

A B+ tree index supports efficient range queries because leaf nodes are linked in sorted order. For a query `WHERE age BETWEEN 25 AND 35`, what is the general access pattern?

  1. A. Binary search the entire leaf level without using the root at all
  2. B. Rebuild the index from scratch for every range query
  3. C. Scan the ENTIRE table, since ranges can't use an index
  4. D. Traverse from the root to the leaf containing 25 (or the first key ≥ 25), then follow the leaf-level linked list forward, collecting matching entries until a key exceeding 35 is reached

Correct answer: D. Traverse from the root to the leaf containing 25 (or the first key ≥ 25), then follow the leaf-level linked list forward, collecting matching entries until a key exceeding 35 is reached

A single root-to-leaf descent locates the starting point of the range; from there, the index simply follows the sequence set (the linked list connecting sibling leaf nodes) sequentially, collecting qualifying entries without needing to redescend the tree for each one — this sequential-leaf-scan is exactly why B+ trees (not plain B-trees or hash indexes) are preferred for range-heavy workloads.

More DBMS and SQL questions

Exams that ask this topic