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. |
|
| ||||
Solution - Interview Questions and Answers for 'Search algorithm' - 4 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 (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 | ||||
| ||||
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 | ||||
| ||||
This question was recently asked at 'HeadStrong,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  Search Algorithm  Sorting Algorithm Asked in 2 Companies basic   frequent | ||||
| ||||
Ans. Relational Database uses linear search if we don't query using indices. Performance for linear search is O(n). If indices have been used , relational database uses binary search. Performance for binary search is O(Log n). Casandra uses hash search. Performance for Hash Search is O(1). | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  cassandra vs oracle  nosql vs relational  search algorithm | ||||