InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
Which of the following is false?(a) 2-3 tree requires less storage than the BST(b) lookup in 2-3 tree is more efficient than in BST(c) 2-3 tree is shallower than BST(d) 2-3 tree is a balanced treeThe above asked question is from B-Trees in chapter B-Trees of Data Structures & Algorithms IThis question was posed to me in quiz. |
|
Answer» CORRECT choice is (a) 2-3 tree REQUIRES less STORAGE than the BST Best explanation: Search is more efficient in the 2-3 tree than in BST. 2-3 tree is a BALANCED tree and performs efficient insertion and deletion and it is shallower than BST. But, 2-3 tree requires more storage than the BST. |
|
| 2. |
AVL trees provide better insertion the 2-3 trees.(a) True(b) FalseQuestion is from B-Trees in division B-Trees of Data Structures & Algorithms IThe question was posed to me in a job interview. |
|
Answer» Correct answer is (B) False |
|
| 3. |
Which of the following is not true about the 2-3 tree?(a) all leaves are at the same level(b) it is perfectly balanced(c) postorder traversal yields elements in sorted order(d) it is B-tree of order 3My question comes from B-Trees in section B-Trees of Data Structures & Algorithms II have been asked this question in class test. |
|
Answer» Right CHOICE is (c) postorder traversal yields elements in sorted order |
|
| 4. |
LLRB maintains 1-1 correspondence with 2–3 trees.(a) True(b) FalseThis is a very interesting question from B-Trees topic in section B-Trees of Data Structures & Algorithms IThe question was posed to me during an online exam. |
|
Answer» Right OPTION is (a) True |
|
| 5. |
Which of the following data structure can provide efficient searching of the elements?(a) unordered lists(b) binary search tree(c) treap(d) 2-3 treeQuestion is from B-Trees in chapter B-Trees of Data Structures & Algorithms IThe question was posed to me in final exam. |
|
Answer» The correct choice is (d) 2-3 tree |
|
| 6. |
Which of the following the BST is isometric with the 2-3 tree?(a) Splay tree(b) AA tree(c) Heap(d) Red – Black treeI'm obligated to ask this question of B-Trees in section B-Trees of Data Structures & Algorithms II had been asked this question in an online quiz. |
|
Answer» Correct answer is (b) AA tree |
|
| 7. |
The height of 2-3 tree with n elements is ______(a) between (n/2) and (n/3)(b) (n/6)(c) between (n) and log2(n + 1)(d) between log3(n + 1) and log2(n + 1)This interesting question is from B-Trees topic in section B-Trees of Data Structures & Algorithms IThis question was addressed to me by my school teacher while I was bunking the class. |
|
Answer» The CORRECT answer is (d) between log3(n + 1) and LOG2(n + 1) |
|
| 8. |
2-3 tree is a specific form of _________(a) B – tree(b) B+ – tree(c) AVL tree(d) HeapQuestion is taken from B-Trees topic in division B-Trees of Data Structures & Algorithms II had been asked this question during an interview. |
|
Answer» Right option is (a) B – tree |
|
| 9. |
Which one of the following data structures are preferred in database-system implementation?(a) AVL tree(b) B-tree(c) B+ -tree(d) Splay treeI would like to ask this question from B-Trees topic in chapter B-Trees of Data Structures & Algorithms II had been asked this question during an interview for a job. |
|
Answer» Right option is (C) B+ -TREE |
|
| 10. |
Which of the following is false?(a) Compared to B-tree, B+ -tree has larger fanout(b) Deletion in B-tree is more complicated than in B+ -tree(c) B+ -tree has greater depth than corresponding B-tree(d) Both B-tree and B+ -tree have same search and insertion efficienciesI want to ask this question from B-Trees topic in section B-Trees of Data Structures & Algorithms II got this question during an interview. |
|
Answer» Correct answer is (C) B+ -tree has greater depth than CORRESPONDING B-tree |
|
| 11. |
What is the maximum number of keys that a B+ -tree of order 3 and of height 3 have?(a) 3(b) 80(c) 27(d) 26I'm obligated to ask this question of B-Trees topic in chapter B-Trees of Data Structures & Algorithms II got this question in a job interview. |
|
Answer» CORRECT option is (d) 26 To EXPLAIN: A B+ tree of ORDER n and height H can have at most n^h – 1 keys. Therefore MAXIMUM number of keys = 3^3 -1 = 27 -1 = 26. |
|
| 12. |
Efficiency of finding the next record in B+ tree is ____(a) O(n)(b) O(log n)(c) O(nlog n)(d) O(1)The above asked question is from B-Trees in chapter B-Trees of Data Structures & Algorithms IThe question was asked in exam. |
|
Answer» CORRECT CHOICE is (d) O(1) BEST explanation: In a B+ -tree finding the next recored (successor) involves accessing an additional LEAF at most. So, the EFFICIENCY of finding the next record is O(1). |
|
| 13. |
Statement 1: When a node is split during insertion, the middle key is promoted to the parent as well as retained in right half-node.Statement 2: When a key is deleted from the leaf, it is also deleted from the non-leaf nodes of the tree.(a) Statement 1 is true but statement 2 is false(b) Statement 2 is true but statement 1 is false(c) Both the statements are true(d) Both the statements are falseI'd like to ask this question from B-Trees in section B-Trees of Data Structures & Algorithms IThe question was posed to me by my college director while I was bunking the class. |
|
Answer» CORRECT CHOICE is (a) Statement 1 is true but statement 2 is false Easy explanation - During the SPLIT, the middle key is retained in the right half node and also promoted to parent node. When a key is deleted from the leaf, it is retained in non-leaves, because it can be still a VALID separator between keys in nodes below. |
|
| 14. |
Which of the following is false?(a) A B+ -tree grows downwards(b) A B+ -tree is balanced(c) In a B+ -tree, the sibling pointers allow sequential searching(d) B+ -tree is shallower than B-treeMy enquiry is from B-Trees in chapter B-Trees of Data Structures & Algorithms IThe question was posed to me during an online exam. |
|
Answer» The CORRECT answer is (a) A B+ -tree grows downwards |
|
| 15. |
A B+ tree can contain a maximum of 7 pointers in a node. What is the minimum number of keys in leaves?(a) 6(b) 3(c) 4(d) 7My question is based upon B-Trees in portion B-Trees of Data Structures & Algorithms IThis question was addressed to me during an internship interview. |
|
Answer» The correct option is (b) 3 |
|
| 16. |
Which of the following is true?(a) B + tree allows only the rapid random access(b) B + tree allows only the rapid sequential access(c) B + tree allows rapid random access as well as rapid sequential access(d) B + tree allows rapid random access and slower sequential accessQuestion is from B-Trees in chapter B-Trees of Data Structures & Algorithms IThe question was posed to me during an interview. |
|
Answer» Right ANSWER is (c) B + tree ALLOWS RAPID random ACCESS as well as rapid sequential access |
|
| 17. |
In a B+ tree, both the internal nodes and the leaves have keys.(a) True(b) FalseQuestion is taken from B-Trees topic in section B-Trees of Data Structures & Algorithms IThe question was posed to me in final exam. |
|
Answer» Correct answer is (b) False |
|
| 18. |
Which of the following is true?(a) larger the order of B-tree, less frequently the split occurs(b) larger the order of B-tree, more frequently the split occurs(c) smaller the order of B-tree, more frequently the split occurs(d) smaller the order of B-tree, less frequently the split occursThis interesting question is from B-Trees topic in division B-Trees of Data Structures & Algorithms II had been asked this question in homework. |
|
Answer» RIGHT option is (a) LARGER the ORDER of B-tree, less frequently the split occurs To explain: The AVERAGE probability of the split is 1/(⌈m / 2⌉ – 1), where m is the order of B-tree. So, if m larger, the probability of split will be less. |
|
| 19. |
Compression techniques can be used on the keys to reduce both space and time requirements in a B-tree.(a) True(b) FalseMy query is from B-Trees topic in portion B-Trees of Data Structures & Algorithms II have been asked this question in an interview. |
|
Answer» Correct answer is (a) True |
|
| 20. |
What is the best case height of a B-tree of order n and which has k keys?(a) logn (k+1) – 1(b) nk(c) logk (n+1) – 1(d) klognThe origin of the question is B-Trees topic in portion B-Trees of Data Structures & Algorithms IThis question was addressed to me in my homework. |
|
Answer» RIGHT CHOICE is (a) logn (K+1) – 1 Easiest EXPLANATION - B-tree of order n and with HEIGHT k has best case height h, where h = logn (k+1) – 1. The best case occurs when all the nodes are completely filled with keys. |
|
| 21. |
2-3-4 trees are B-trees of order 4. They are an isometric of _____ trees.(a) AVL(b) AA(c) 2-3(d) Red-BlackThis question is from B-Trees in chapter B-Trees of Data Structures & Algorithms II had been asked this question by my school teacher while I was bunking the class. |
|
Answer» Right CHOICE is (d) Red-Black |
|
| 22. |
B-tree and AVL tree have the same worst case time complexity for insertion and deletion.(a) True(b) FalseMy question is taken from B-Trees topic in section B-Trees of Data Structures & Algorithms IThis question was posed to me at a job interview. |
|
Answer» Right ANSWER is (a) True |
|
| 23. |
Five node splitting operations occurred when an entry is inserted into a B-tree. Then how many nodes are written?(a) 14(b) 7(c) 11(d) 5Query is from B-Trees in division B-Trees of Data Structures & Algorithms II got this question during an interview. |
|
Answer» Right answer is (C) 11 |
|
| 24. |
A B-tree of order 4 and of height 3 will have a maximum of _______ keys.(a) 255(b) 63(c) 127(d) 188I would like to ask this question from B-Trees in portion B-Trees of Data Structures & Algorithms II had been asked this question during an interview for a job. |
|
Answer» The correct choice is (a) 255 |
|
| 25. |
B-tree of order n is a order-n multiway tree in which each non-root node contains __________(a) at most (n – 1)/2 keys(b) exact (n – 1)/2 keys(c) at least 2n keys(d) at least (n – 1)/2 keysEnquiry is from B-Trees in portion B-Trees of Data Structures & Algorithms IThis question was addressed to me during an interview for a job. |
|
Answer» Right choice is (d) at LEAST (N – 1)/2 keys |
|
| 26. |
Which of the following is the most widely used external memory data structure?(a) AVL tree(b) B-tree(c) Red-black tree(d) Both AVL tree and Red-black treeQuestion is taken from B-Trees in portion B-Trees of Data Structures & Algorithms IThis question was posed to me in a job interview. |
|
Answer» Correct ANSWER is (b) B-tree |
|