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. |
Is it possible to perform a split operation on a string in the rope if the split point is in the middle of the string.(a) True(b) FalseI'm obligated to ask this question of Binary Trees topic in chapter Binary Trees of Data Structures & Algorithms II got this question during an internship interview. |
|
Answer» RIGHT answer is (a) True Easiest explanation - In order to perform the splitting on the rope data STRUCTURE, ONE can split the given string into two new string S1 and S2 in O (log n) time. So, the time complexity for worst case is O (log n). The split operation can be performed if the split point is either at the end of the string or in the middle of the string. |
|
| 2. |
What is the time complexity for deleting the string to form a new string in the rope data structure?(a) O (n^2)(b) O (n!)(c) O (log n)(d) O (1)This is a very interesting question from Binary Trees in portion Binary Trees of Data Structures & Algorithms IThis question was posed to me in my homework. |
|
Answer» Correct choice is (c) O (log N) |
|
| 3. |
Is insertion and deletion operation faster in rope than an array?(a) True(b) FalseThis intriguing question originated from Binary Trees topic in section Binary Trees of Data Structures & Algorithms II got this question in an interview for job. |
|
Answer» Right choice is (a) True |
|
| 4. |
What is the time complexity for inserting the string and forming a new string in the rope data structure?(a) O (log n)(b) O (n!)(c) O (n^2)(d) O (1)The above asked question is from Binary Trees topic in section Binary Trees of Data Structures & Algorithms IThe question was asked by my school principal while I was bunking the class. |
|
Answer» RIGHT option is (a) O (log n) For explanation: In ORDER to perform the INSERTION on the rope data structure, one can insert the given string at any position X to form a new string in O (log n) time. So, the time complexity for worst case is O (log n). This can be done by one SPLIT operation and two concatenation operations. |
|
| 5. |
Which type of binary tree does rope require to perform basic operations?(a) Unbalanced(b) Balanced(c) Complete(d) FullMy question is taken from Binary Trees topic in division Binary Trees of Data Structures & Algorithms IThe question was posed to me during an online interview. |
|
Answer» The correct OPTION is (b) Balanced |
|
| 6. |
What is the time complexity for splitting the string into two new string in the rope data structure?(a) O (n^2)(b) O (n!)(c) O (log n)(d) O (1)This intriguing question comes from Binary Trees topic in portion Binary Trees of Data Structures & Algorithms II got this question in final exam. |
|
Answer» Correct choice is (c) O (log n) |
|
| 7. |
What is the time complexity for creating a new node and then performing concatenation in the rope data structure?(a) O (log n)(b) O (n!)(c) O (n^2)(d) O (1)This interesting question is from Binary Trees topic in portion Binary Trees of Data Structures & Algorithms IThe question was posed to me in an interview for internship. |
|
Answer» Correct option is (d) O (1) |
|
| 8. |
What is the time complexity for finding the node at x position where n is the length of the rope?(a) O (log n)(b) O (n!)(c) O (n^2)(d) O (1)I need to ask this question from Binary Trees in division Binary Trees of Data Structures & Algorithms IThis question was addressed to me in a job interview. |
|
Answer» RIGHT option is (a) O (log N) For explanation: In order to FIND the node at x position in a rope data structure where N is the length of the rope, we start a recursive SEARCH from the root node. So the time complexity for worst case is FOUND to be O (log N). |
|
| 9. |
Which type of data structure does rope represent?(a) Array(b) Linked List(c) Queue(d) Binary TreeAsked question is from Binary Trees in chapter Binary Trees of Data Structures & Algorithms IThis question was posed to me in final exam. |
|
Answer» Correct option is (d) Binary Tree |
|
| 10. |
Which of the following is also known as Rope data structure?(a) Cord(b) String(c) Array(d) Linked ListMy enquiry is from Binary Trees in chapter Binary Trees of Data Structures & Algorithms IThe question was posed to me during a job interview. |
|
Answer» Correct answer is (a) Cord |
|
| 11. |
Which of the following is the self-adjusting binary search tree?(a) AVL Tree(b) Splay Tree(c) Top Tree(d) Ternary TreeMy question is taken from Binary Trees in portion Binary Trees of Data Structures & Algorithms II had been asked this question during an online exam. |
|
Answer» Correct option is (B) Splay Tree |
|
| 12. |
What is the time complexity for the update cost on auxiliary trees?(a) O (log (log n))(b) k-1 O (log n)(c) K^2 O (log n)(d) k+1 O (log (log n))This interesting question is from Binary Trees topic in chapter Binary Trees of Data Structures & Algorithms IThis question was posed to me by my school principal while I was bunking the class. |
|
Answer» The correct OPTION is (d) k+1 O (LOG (log n)) |
|
| 13. |
What is the time complexity for searching k+1 auxiliary trees?(a) k+2 O (log (log n))(b) k+1 O (log n)(c) K+2 O (log n)(d) k+1 O (log (log n))I'd like to ask this question from Binary Trees topic in division Binary Trees of Data Structures & Algorithms II had been asked this question in an interview for internship. |
|
Answer» The correct option is (d) k+1 O (log (log n)) |
|
| 14. |
What is the upper bound for a tango tree if k is a number of interleaves?(a) k+2 O (log (log n))(b) k O (log n)(c) K^2 O (log n)(d) k+1 O (log (log n))My doubt is from Binary Trees topic in chapter Binary Trees of Data Structures & Algorithms IThis question was posed to me during a job interview. |
|
Answer» The CORRECT choice is (d) k+1 O (log (log n)) |
|
| 15. |
Which operation is used to break a preferred path into two sets of parts at a particular node?(a) Differentiate(b) Cut(c) Integrate(d) JoinMy doubt stems from Binary Trees in section Binary Trees of Data Structures & Algorithms IThe question was posed to me in an interview. |
|
Answer» Correct answer is (b) Cut |
|
| 16. |
Is partitioning method used by Tango Tree.(a) True(b) FalseThe doubt is from Binary Trees topic in division Binary Trees of Data Structures & Algorithms II had been asked this question during an online interview. |
|
Answer» Correct option is (a) True |
|
| 17. |
Which operation is used to combine two auxiliary trees?(a) Join(b) Combinatorial(c) Add(d) ConcatenationThis is a very interesting question from Binary Trees in portion Binary Trees of Data Structures & Algorithms IThe question was posed to me by my college director while I was bunking the class. |
|
Answer» The correct option is (a) JOIN |
|
| 18. |
Is tango tree represented as a tree of trees.(a) True(b) FalseMy doubt stems from Binary Trees in portion Binary Trees of Data Structures & Algorithms IThe question was asked in final exam. |
|
Answer» RIGHT ANSWER is (a) True Easiest explanation - Partitioning METHOD is used by tango tree which partitions a binary search tree into small sets of paths and then STORING them to auxiliary trees. HENCE tango tree is represented as a tree of trees. |
|
| 19. |
Which special balanced binary search tree is used to store the nodes of auxiliary tree?(a) Red – Black Tree(b) Red – Brown Tree(c) Red – Yellow Tree(d) Red – Tango TreeThis intriguing question comes from Binary Trees in portion Binary Trees of Data Structures & Algorithms IThe question was posed to me during an interview. |
|
Answer» Correct option is (a) Red – Black Tree |
|
| 20. |
Which type of binary search tree is imitated for construction of tango tree?(a) Complete Binary Search Tree(b) Perfect Binary Search Tree(c) Balanced Binary Search Tree(d) Degenerate Binary Search TreeMy doubt is from Binary Trees topic in chapter Binary Trees of Data Structures & Algorithms II had been asked this question in unit test. |
|
Answer» Correct choice is (a) COMPLETE Binary Search Tree |
|
| 21. |
What is the time complexity of for achieving competitive ratio by tango tree?(a) O (log n)(b) O (n^2)(c) O (n!)(d) O (log (log n))My question is based upon Binary Trees topic in section Binary Trees of Data Structures & Algorithms II had been asked this question in an internship interview. |
|
Answer» The correct choice is (d) O (log (log n)) |
|
| 22. |
Which type of binary search tree or algorithm does tango tree use?(a) Online(b) Offline(c) Static(d) DynamicThe doubt is from Binary Trees in section Binary Trees of Data Structures & Algorithms II have been asked this question in homework. |
|
Answer» CORRECT answer is (d) Dynamic Explanation: Tango tree is an ONLINE binary search tree whose time complexity is O (log (log n)) when compared to the time complexity of OFFLINE binary search tree MODEL. Online algorithm processes input or data provided PIECE by piece. |
|
| 23. |
After which city is tango tree named?(a) Vatican City(b) Buenos Aires(c) New York(d) CaliforniaMy query is from Binary Trees in division Binary Trees of Data Structures & Algorithms II have been asked this question in quiz. |
|
Answer» The correct CHOICE is (b) Buenos Aires |
|
| 24. |
Which type of tree is tango tree?(a) Ternary Tree(b) AVL Tree(c) Binary Search Tree(d) K-ary TreeI'm obligated to ask this question of Binary Trees topic in chapter Binary Trees of Data Structures & Algorithms IThis question was addressed to me in final exam. |
|
Answer» Right answer is (c) Binary Search Tree |
|
| 25. |
Who developed the concept of tango tree?(a) Erik Demaine(b) Mihai Patrascu(c) John Lacono(d) All of the mentionedOrigin of the question is Binary Trees in division Binary Trees of Data Structures & Algorithms IThis question was addressed to me by my college professor while I was bunking the class. |
|
Answer» Right answer is (d) All of the mentioned |
|
| 26. |
What is inefficient with the below threaded binary tree picture?(a) it has dangling pointers(b) nothing inefficient(c) incorrect threaded tree(d) space is being used moreMy question comes from Threaded Binary Tree in portion Binary Trees of Data Structures & Algorithms IThis question was posed to me in an interview for internship. |
|
Answer» Right answer is (a) it has DANGLING pointers |
|
| 27. |
What are double and single threaded trees?(a) when both left, right nodes are having null pointers and only right node is null pointer respectively(b) having 2 and 1 node(c) using single and double linked lists(d) using heaps and priority queuesOrigin of the question is Threaded Binary Tree in section Binary Trees of Data Structures & Algorithms IThis question was posed to me in a national level competition. |
|
Answer» Correct choice is (a) when both LEFT, RIGHT NODES are having null POINTERS and only right NODE is null pointer respectively |
|
| 28. |
Which of the following tree traversals work if the null left pointer pointing to the predecessor and null right pointer pointing to the successor in a binary tree?(a) inorder, postorder, preorder traversals(b) inorder(c) postorder(d) preorderThe doubt is from Threaded Binary Tree in portion Binary Trees of Data Structures & Algorithms II got this question during an interview. |
|
Answer» Correct choice is (a) inorder, postorder, preorder traversals |
|
| 29. |
What are null nodes filled with in a threaded binary tree?(a) inorder predecessor for left node and inorder successor for right node information(b) right node with inorder predecessor and left node with inorder successor information(c) they remain null(d) some other values randomlyMy doubt is from Threaded Binary Tree in chapter Binary Trees of Data Structures & Algorithms II got this question by my college director while I was bunking the class. |
|
Answer» CORRECT choice is (a) inorder predecessor for LEFT NODE and inorder successor for right node information The best I can explain: If preorder or POSTORDER is used then the respective predecessor and successor info is STORED. |
|
| 30. |
In general, the node content in a threaded binary tree is ________(a) leftchild_pointer, left_tag, data, right_tag, rightchild_pointer(b) leftchild_pointer, left_tag(c) leftchild_pointer, left_tag, right_tag, rightchild_pointer(d) leftchild_pointer, left_tag, dataQuestion is taken from Threaded Binary Tree in portion Binary Trees of Data Structures & Algorithms IThis question was addressed to me in homework. |
|
Answer» The correct answer is (a) leftchild_pointer, left_tag, data, right_tag, rightchild_pointer |
|
| 31. |
What are the disadvantages of normal binary tree traversals?(a) there are many pointers which are null and thus useless(b) there is no traversal which is efficient(c) complexity in implementing(d) improper traversalsMy enquiry is from Threaded Binary Tree in chapter Binary Trees of Data Structures & Algorithms IThe question was asked in an interview. |
|
Answer» Right CHOICE is (a) there are many pointers which are null and thus useless |
|
| 32. |
What is a threaded binary tree traversal?(a) a binary tree traversal using stacks(b) a binary tree traversal using queues(c) a binary tree traversal using stacks and queues(d) a binary tree traversal without using stacks and queuesOrigin of the question is Threaded Binary Tree topic in chapter Binary Trees of Data Structures & Algorithms IThe question was posed to me during an interview. |
|
Answer» RIGHT ANSWER is (d) a binary tree traversal WITHOUT using STACKS and queues For explanation: This type of tree traversal will not use STACK or queue. |
|
| 33. |
Who invented treaps?(a) Cecilia and Raimund(b) Arne Andersson(c) Donald Shell(d) Harris and RossMy query is from Binary Trees topic in division Binary Trees of Data Structures & Algorithms IThis question was addressed to me in a job interview. |
|
Answer» Correct answer is (a) Cecilia and Raimund |
|
| 34. |
What is the priority of a null node?(a) 1(b) 0(c) random number(d) infinityMy doubt is from Binary Trees in division Binary Trees of Data Structures & Algorithms II got this question in an online quiz. |
|
Answer» The correct answer is (d) INFINITY |
|
| 35. |
Which node has the lowest priority in a treap?(a) root node(b) leaf node(c) null node(d) centre nodeThe query is from Binary Trees topic in chapter Binary Trees of Data Structures & Algorithms II got this question during a job interview. |
|
Answer» RIGHT choice is (a) ROOT node The best explanation: A root node has the LOWEST priority in a treap SINCE the node’s priority is based on heap order. |
|
| 36. |
What is the average running time of a treap?(a) O(N)(b) O(N log N)(c) O(log N)(d) O(M log N)This intriguing question comes from Binary Trees topic in chapter Binary Trees of Data Structures & Algorithms IThis question was addressed to me in a national level competition. |
|
Answer» RIGHT answer is (c) O(log N) For EXPLANATION: The AVERAGE case and worst case analysis of a TREAP are MATHEMATICALLY found to be O(log N). |
|
| 37. |
Several other operations like union set difference and intersection can be done in treaps.(a) True(b) FalseMy enquiry is from Binary Trees in division Binary Trees of Data Structures & Algorithms II had been asked this question during an online exam. |
|
Answer» Right ANSWER is (a) True |
|
| 38. |
What is the condition for priority of a node in a treap?(a) a node’s priority should be greater than its parent(b) a node’s priority should be at least as large as its parent(c) the priority is randomly assigned and can have any value(d) a node’s priority is always given in decreasing orderThis interesting question is from Binary Trees topic in chapter Binary Trees of Data Structures & Algorithms IThe question was asked at a job interview. |
|
Answer» Right choice is (B) a NODE’s priority should be at least as LARGE as its parent |
|
| 39. |
A treap is a combination of a tree and a heap.(a) false(b) trueMy doubt is from Binary Trees in section Binary Trees of Data Structures & Algorithms IThe question was asked during an online exam. |
|
Answer» RIGHT option is (b) true Easy explanation - A treap is a COMBINATION of a TREE and a heap. The STRUCTURE of a treap is DETERMINED by the fact that it is heap-ordered. |
|
| 40. |
What is the reason behind the simplicity of a treap?(a) Each node has data and a pointer(b) Each node is colored accordingly(c) It is a binary search tree following heap principles(d) Each node has a fixed priority fieldI would like to ask this question from Binary Trees in division Binary Trees of Data Structures & Algorithms II have been asked this question during an interview. |
|
Answer» Right option is (d) Each NODE has a FIXED PRIORITY field |
|
| 41. |
Which is the simplest of all binary search trees?(a) AVL tree(b) Treap(c) Splay tree(d) Binary heapThe origin of the question is Binary Trees topic in division Binary Trees of Data Structures & Algorithms IThe question was asked in my homework. |
|
Answer» The correct OPTION is (b) TREAP |
|
| 42. |
What is the space complexity of a treap algorithm?(a) O(N)(b) O(log N)(c) O(log N)(d) O(N^2)The above asked question is from Binary Trees in section Binary Trees of Data Structures & Algorithms IThe question was asked during an interview. |
|
Answer» The correct answer is (a) O(N) |
|
| 43. |
What is the disadvantage of using splay trees?(a) height of a splay tree can be linear when accessing elements in non decreasing order.(b) splay operations are difficult(c) no significant disadvantage(d) splay tree performs unnecessary splay when a node is only being readThe doubt is from Splay Tree topic in section Binary Trees of Data Structures & Algorithms II got this question during an interview for a job. |
|
Answer» The CORRECT option is (a) height of a SPLAY tree can be LINEAR when accessing elements in non decreasing order. |
|
| 44. |
After the insertion operation, is the resultant tree a splay tee?(a) true(b) falseMy question is taken from Splay Tree topic in portion Binary Trees of Data Structures & Algorithms IThis question was addressed to me in an online interview. |
|
Answer» Right option is (a) true |
|
| 45. |
When we have red-black trees and AVL trees that can perform most of operations in logarithmic times, then what is the need for splay trees?(a) no there is no special usage(b) In real time it is estimated that 80% access is only to 20% data, hence most used ones must be easily available(c) redblack and avl are not upto mark(d) they are just another type of self balancing binary search treesMy question comes from Splay Tree in portion Binary Trees of Data Structures & Algorithms II had been asked this question in exam. |
|
Answer» Right option is (b) In REAL TIME it is estimated that 80% access is only to 20% data, hence most USED ones must be easily available |
|
| 46. |
Which of the following options is an application of splay trees?(a) cache Implementation(b) networks(c) send values(d) receive valuesI'm obligated to ask this question of Splay Tree topic in division Binary Trees of Data Structures & Algorithms II have been asked this question in an internship interview. |
|
Answer» Right answer is (a) cache Implementation |
|
| 47. |
What is a splay operation?(a) moving parent node to down of child(b) moving a node to root(c) moving root to leaf(d) removing leaf nodeMy enquiry is from Splay Tree in portion Binary Trees of Data Structures & Algorithms IThis question was addressed to me by my school principal while I was bunking the class. |
|
Answer» Right CHOICE is (b) MOVING a node to root |
|
| 48. |
Is it true that splay trees have O(logn) amortized complexity ?(a) true(b) falseEnquiry is from Splay Tree topic in section Binary Trees of Data Structures & Algorithms II had been asked this question by my school teacher while I was bunking the class. |
|
Answer» The correct choice is (a) true |
|
| 49. |
Why to prefer splay trees?(a) easier to program(b) space efficiency(c) easier to program and faster access to recently accessed items(d) quick searchingMy enquiry is from Splay Tree topic in portion Binary Trees of Data Structures & Algorithms IThis question was addressed to me in a national level competition. |
|
Answer» Right choice is (c) easier to program and faster access to recently accessed items |
|
| 50. |
Which of the following property of splay tree is correct?(a) it holds probability usage of the respective sub trees(b) any sequence of j operations starting from an empty tree with h nodes atmost, takes O(jlogh) time complexity(c) sequence of operations with h nodes can take O(logh) time complexity(d) splay trees are unstable treesMy doubt is from Splay Tree in division Binary Trees of Data Structures & Algorithms II got this question in examination. |
|
Answer» The correct choice is (b) any sequence of j operations STARTING from an empty tree with h nodes atmost, takes O(jlogh) time complexity |
|