Algorithm - Interview Questions and Answers for 'Binary search' | Search Interview Question - javasearch.buggybread.com
Javasearch.buggybread.com

Search Interview Questions


 More than 3000 questions in repository.
 There are more than 900 unanswered questions.
Click here and help us by providing the answer.
 Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company      Label / Company / Text

   



Algorithm - Interview Questions and Answers for 'Binary search' - 7 question(s) found - Order By Rating

 Q1. What are the disadvantages of binary search trees? Algorithm
 This question was recently asked at 'ServiceNow'.This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     binary search tree     Asked in 1 Companies


 Q2. Explain Binary SearchAlgorithm
 This question was recently asked at 'Nagarvision'.This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     search  binary search     Asked in 1 Companies      basic        frequent


 Q3. How Cassandra provides better Read performance than Oracle Indices ?Database
Ans. Cassandra uses Hash Search which provides a look time of O(1) whereas Oracle Indices uses Binary Search that provide a lookup time of O(Log n).

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     cassandra  hash search  hash search vs binary search


Frequently asked to Fresh graduates.
 Q4. Write a program to implement Binary search ?Core Java
Ans. http://algs4.cs.princeton.edu/11model/BinarySearch.java.html

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     binary search  search     Asked in 5 Companies      basic        frequent

Try 1 Question(s) Test


 Q5. Can we use Ordered Set for performing Binary Search ?
Ans. We need to access values on the basis of an index in Binary search which is not possible with Sets.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java   sets   set   collections   binary search


 Q6. What are the pre-requisite for the collection to perform Binary Search ?
Ans. 1. Collection should have an index for random access.
2. Collection should have ordered elements.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java   collections   search algorithm   search   binary search   at&t      intermediate


Advanced level question frequently asked in US based companies. Recently asked in EMC and Intuit.
  Q7. Can you provide some implementation of a Dictionary having large number of words ? Solution
Ans. Simplest implementation we can have is a List wherein we can place ordered words and hence can perform Binary Search.

Other implementation with better search performance is to use HashMap with key as first character of the word and value as a LinkedList.

Further level up, we can have linked Hashmaps like ,

hashmap {
a ( key ) -> hashmap (key-aa , value (hashmap(key-aaa,value)
b ( key ) -> hashmap (key-ba , value (hashmap(key-baa,value)
....................................................................................
z( key ) -> hashmap (key-za , value (hashmap(key-zaa,value)
}

upto n levels ( where n is the average size of the word in dictionary.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java   collections   hashmap   binary search   search algorithm   advanced   architecture   data structure     Asked in 6 Companies        frequent

Try 1 Question(s) Test


 Q8. Binary Search requires that the collection should beAlgorithm
a. Sorted in Ascending Order
b. Sorted in Descending Order
c. Sorted in any Order
d. Unsorted

Ans.c. Sorted in any Order


Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked: