0
0
DBMS Theoryknowledge~20 mins

B+ tree index structure in DBMS Theory - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
B+ Tree Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
How does a B+ tree maintain sorted data?

In a B+ tree index, how is the data kept sorted for efficient searching?

AData is stored in all nodes, but only root node keeps data sorted.
BData is stored only in leaf nodes, which are linked in sorted order.
CData is stored randomly in leaf nodes and sorted in internal nodes.
DData is stored only in internal nodes, leaf nodes are empty.
Attempts:
2 left
💡 Hint

Think about where actual records or pointers to records are stored in a B+ tree.

query_result
intermediate
1:30remaining
Number of keys in a B+ tree node

Given a B+ tree of order 4 (maximum 4 children per node), what is the maximum number of keys a single internal node can hold?

A3
B2
C5
D4
Attempts:
2 left
💡 Hint

Remember, the number of keys in an internal node is one less than the number of children.

📋 Factual
advanced
2:30remaining
Identify the correct leaf node split in B+ tree insertion

When inserting a new key into a full leaf node in a B+ tree of order 3, which option correctly shows the resulting split?

DBMS Theory
Initial leaf node keys: [10, 20, 30]
Insert key: 25
Order: 3 (max 3 children, max 2 keys per node)
ALeft leaf: [10, 25], Right leaf: [20, 30], Promote key: 20
BLeft leaf: [10, 20, 25], Right leaf: [30], Promote key: 30
CLeft leaf: [10, 20], Right leaf: [25, 30], Promote key: 25
DLeft leaf: [10], Right leaf: [20, 25, 30], Promote key: 20
Attempts:
2 left
💡 Hint

Recall that after splitting, the middle key is promoted to the parent node.

optimization
advanced
2:00remaining
Choosing B+ tree order for disk block size

You want to optimize a B+ tree index for a disk block size of 4KB. Which factor is most important when choosing the order of the B+ tree?

AMaximize the number of keys per node to fill the 4KB block efficiently.
BMinimize the number of keys per node to reduce search time inside nodes.
CChoose order so that each node fits multiple disk blocks for faster access.
DChoose order randomly since disk block size does not affect B+ tree order.
Attempts:
2 left
💡 Hint

Think about how disk reads work and how node size relates to block size.

🔍 Analysis
expert
3:00remaining
Why does this B+ tree search fail to find a key?

Given a B+ tree search algorithm that always moves to the leftmost child if the key is less than the first key in the node, what is the likely cause of missing keys during search?

AThe algorithm only searches leaf nodes and ignores internal nodes.
BThe leaf nodes are not linked, so the search cannot continue sequentially.
CThe root node is not checked for keys before descending.
DThe algorithm does not correctly choose the child pointer based on key ranges in internal nodes.
Attempts:
2 left
💡 Hint

Consider how B+ tree internal nodes guide the search to the correct child.