Search Interview Questions  3167 questions in repository. There are more than 200 unanswered questions. Click here and help us by providing the answer. Have a video suggestion. Click Correct / Improve and please let us know. 

 
Algorithm  Interview Questions and Answers for 'Binary'  11 question(s) found  Order By Newest  
Advanced level question frequently asked in US based companies. Recently asked in EMC and Intuit.  
_{}
 
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 (keyaa , value (hashmap(keyaaa,value) b ( key ) > hashmap (keyba , value (hashmap(keybaa,value) .................................................................................... z( key ) > hashmap (keyza , value (hashmap(keyzaa,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 Dell EMC Intuit Corporate Brokers PWC India Yahoo Oracle frequentCorrectionDuplicate of Another QuestionCompany where this question was AskedSuggestion}  
Try 1 Question(s) Test  
 
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 intermediateCorrectionDuplicate of Another QuestionCompany where this question was AskedSuggestion}  
_{}
 
Ans. Binary tree is a tree in which each node has up to two children.Tree is a data structure composed of nodes.Each tree has a root node(not necessary in graph theory). The root node has zero or more child nodes.Each child node has zero or more child nodes, and so on.The tree cannot contain cycles.  
Help us improve. Please let us know the company, where you were asked this question :  
_{ Like Discuss Correct / Improve binary tree DeloitteCorrectionDuplicate of Another QuestionCompany where this question was AskedSuggestion}  
 
Ans. Both bitwise right shift operator ( >> ) and bitwise zero fill right shift operator ( >>> ) are used to shift the bits towards right. The difference is that >> will protect the sign bit whereas the >>> operator will not protect the sign bit. It always fills 0 in the sign bit.  
Help us improve. Please let us know the company, where you were asked this question :  
_{ Like Discuss Correct / Improve java operators bitwise operators binary shift right shiftCorrectionDuplicate of Another QuestionCompany where this question was AskedSuggestion}  
_{}
 
Ans. convert(int binaryInt) { int sumValue=0; int multiple = 1; while(binaryInt > 0){ binaryDigit = binaryInt%10; binaryInt = binaryInt /10; sumValue = sumValue + (binaryDigit * multiple); multiple = multiple * 2; } return sumValue; }  
Help us improve. Please let us know the company, where you were asked this question :  
_{ Like Discuss Correct / Improve java binary interesting question codingCorrectionDuplicate of Another QuestionCompany where this question was AskedSuggestion}  
 
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 searchCorrectionDuplicate of Another QuestionCompany where this question was AskedSuggestion}  
Frequently asked to Fresh graduates.  
_{}
 
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 Cognizant (CTS) Click Labs Infoview Technologies Mahindra Comviva Acute Informatics basic frequentCorrectionDuplicate of Another QuestionCompany where this question was AskedSuggestion}  
Try 1 Question(s) Test  
_{}
 
^{This question was recently asked at 'Amazon'.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 tree AmazonCorrectionDuplicate of Another QuestionCompany where this question was AskedSuggestion}  
_{}
 
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 searchCorrectionDuplicate of Another QuestionCompany where this question was AskedSuggestion}  
Do you think these are the Best Java Frameworks ?
 
_{}
 
^{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 Nagarvision basic frequentCorrectionDuplicate of Another QuestionCompany where this question was AskedSuggestion}  
 