Java - Interview Questions and Answers for 'Search' | Search Java Interview Question - javasearch.buggybread.com
Javasearch.buggybread.com
Share

Search Java Interview Questions


 2098 questions in repository.
 There are more than 200 unanswered questions.
Click here and help us by providing the answer.
Label / Company      Label / Company / Text

   



BuggyBread - Search Java Classes and Packages



Link: http://javasearch.buggybread.com/
   




Interview Questions and Answers for 'Search' - 10 question(s) found - Order By Newest

Advanced level question frequently asked in US based companies. Recently asked in EMC and Intuit.
  Q1. Can you provide some implementation of a Dictionary having large number of words ? Solution
Admin
info@buggybread.com
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     Dell EMC   Intuit   Corporate Brokers  PWC India  Yahoo  Oracle        frequent

Try 1 Question(s) Test


 Q2. What are the pre-requisite for the collection to perform Binary Search ?
Admin
info@buggybread.com
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


 Q3. Can we use Ordered Set for performing Binary Search ?
Admin
info@buggybread.com
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


Frequently asked to Fresh graduates.
 Q4. Write a program to implement Binary search ?Core Java2016-10-18 10:49:58

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        frequent

Try 1 Question(s) Test


 Q5. What is Spring Boot ?Spring2016-12-19 06:23:21

Ans. Spring Boot is Springs convention-over-configuration solution for creating stand-alone, production-grade Spring-based Applications.

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

   Like      Discuss      Correct / Improve          JP Morgan Chase (JPMC)  Silver Search  Magna Infotech  General Dynamics  MphasiS  Narvar


  Q6. What is Maven ?Maven2016-12-19 10:53:13

Ans. Maven is a build automation tool used primarily for Java projects.

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

   Like      Discuss      Correct / Improve     maven  build     Defence Research & Development Organisation (DRDO)  MPS  Infosys  Indra  InterGlobe Technologies  HSBC Holdings      basic        frequent


 Q7. Write a Program to print factorial of a number using recursionCore Java2017-01-29 17:47:20

Ans. public class BuggyBread {
public static void main(String args[]) {
System.out.println(factorial(5));
}

private static int factorial(int number){
if(number == 1){
return 1;
} else {
return number * factorial(number - 1);
}
}
}

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

   Like      Discuss      Correct / Improve     recursion     PrimeFocus Technologies  Aavanor System  Mobicip  CMSS Private Limited  Intrepid Pursuits  Indus Valley Partners  Sunquest Information Systems  Linchpin  Riverbed Technology  Knoldus Software  Sopra Steria  Sunquest Information Systems  OpenBet  DMX Technologies  Whitesnow Software Consultancy  NextSphere  Clearwater Analytics  Obelisk Infosystems  iNautix Technologies  Andesa Services  NextSphere  MobileIron  Wolfram Research  Spillman Technologies


 Q8. How Cassandra provides better Read performance than Oracle Indices ?Database2017-08-18 09:39:56

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


 Q9. How different is the Search algorithm when we query Cassandra Tables and When we query Oracle Tables ?Cassandra2017-08-18 09:40:40

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


 Q10. 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



Subscribe to Java News and Posts. Get latest updates and posts on Java from Buggybread.com
Enter your email address:
Delivered by FeedBurner



comments powered by Disqus
 

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:
         

X Close this

4 person from are looking for questions for 'Search'. Connect with them to better prepare for your interview.Click here and post a message

X Close this

Help Us Improve.
Please share your
interview experience.

Company Name:   


Questions Asked: