Interview Questions on Binary Search Set 1

This is my quiz series covering questions only on binary search. The level of these questions is that of a beginner. This is quiz no. 1 in this series.

Last Reviewed and Updated on February 7, 2020
Posted by Parveen(Hoven),
Aptitude Trainer and Software Developer

Quiz Questions

Each question has four choices. More than one options can be correct. When you have finished the quiz, click the button at the end of the questions to view the result, and the solutions and answers.

Question 1

In linear probing, sequential search for an empty position becomes very ___ ?
A
Easy
B
Time consuming
C
Medium
D
None of them
Soln.
Ans: B
In linear probing, sequential search for an empty position becomes very Time consuming.

Question 2

Which type of data structure is used in binary search?
A
Tree
B
C
Array
D
None of them
Soln.
Ans: C

Question 3

Which of these is not used for resolving collision.
A
Coalesced Chaining
B
Separate Chaining
C
Similar Chaining
D
A and B both are chaining technique
Soln.
Ans: C
Similar chaining is not chaining technique used for resolving collision.

Question 4

To Implement _________ Search algorithm, the list should be sorted
A
Binary Search
B
Both
C
Linear Search
D
none of them
Soln.
Ans: A
Binary Search algorithm is based on the preceding approach for searching an item in a sorted list.

Question 5

Open Address hashing does not include?
A
Linear probing
B
C
Double Hashing
D
Separate Chaining
Soln.
Ans: D
Separate Chaining is not included in open address hashing

Question 6

Which of the following is not a required condition for the binary search algorithm?
A
The list must be sorted
B
there should be the direct access to the middle element in any sub-list
C
There must be mechanism to delete and/or insert elements in list
D
none of above
Soln.
Ans: C
There must be mechanism to delete and/or insert elements in list.

Question 7

To apply binary search algorithm, you should ensure that the list to be searched is___________
A
Unsorted
B
Partially sorted
C
Sorted
D
all of them
Soln.
Ans: C
To apply binary search algorithm, you should ensure that the list to be searched is sorted list.

Question 8

What is the worst case complexity of binary search?
A
O(n log n)
B
O(1)
C
O(log n)
D
O(n)
Soln.
Ans: B
The worst case complexity of binary search is O(1).

Question 9

What is the average case performance of binary search?
A
O(n log n)
B
O(log n)
C
O(1)
D
O(n)
Soln.
Ans: B
The average case performance of binary search is O(log n).

Question 10

Is it true that alphanumeric keys are usually converted into numeric keys before the hashing function can operate on them.
A
False
B
True
C
unknown statement
D
None
Soln.
Ans: B
Yes, it is true that alphanumeric keys are usually converted into numeric keys before the hashing function can operate on them.