 
| 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. | 
| 
 | |||
|  | ||||
| Interview Questions and Answers - Order By Newest | ||||
|    | ||||
| 
 | ||||
| Ans. Reliability and Continuity if some of the sites goes down.Easy Scaling up and Down as sites can be added or removed without impacting business continuity. | ||||
|  Help us improve. Please let us know the company, where you were asked this question  : | ||||
|  Discuss  Correct / Improve   dbms  database management system  distributed database management system  Asked in 1 Companies | ||||
|  Frequently asked in face to face interviews. | ||||
| 
 | ||||
| Ans. int count = 15; int[] fibonacci = new int[count]; fibonacci[0] = 0; fibonacci[1] = 1; for(int x=2; x < count; x++){ fibonacci[x] = fibonacci[x-1] + fibonacci[x-2]; } for(int x=0; x< count; x++){ System.out.print(fibonacci[x] + " "); } | ||||
|  Help us improve. Please let us know the company, where you were asked this question  : | ||||
|  Discuss  Correct / Improve   ebay   fibonacci series  Asked in 66 Companies  basic       frequent | ||||
| 
 | ||||
| Ans. Yes, the array list can hold more elements. Final only puts the restriction that the array list reference cannot hold any other array list. | ||||
|  Help us improve. Please let us know the company, where you were asked this question  : | ||||
|  Discuss  Correct / Improve   ebay   collections   arraylist   final keyword | ||||
| 
 | ||||
| Ans. [ Open Ended question ] | ||||
|  Help us improve. Please let us know the company, where you were asked this question  : | ||||
|  Discuss  Correct / Improve   data structures   open ended questions   load balancer | ||||
| 
 | ||||
| Ans. This error most likely will be thrown during an insert statement, while inserting a value within a foreign key column which doesnt exist within the Parent column. For example - Trying to add a dept number reference within a Employee Table when the Dept doesnt exist in the Dept Table. | ||||
|  Help us improve. Please let us know the company, where you were asked this question  : | ||||
|  Discuss  Correct / Improve   database  integrity constraint error  integrity constraint violated | ||||
| 
 | ||||
| Ans. The goal of a synchronised block is to achieve mutual exclusion i.e at one time, the segment of the code should be executed by single thread only and hence the lock needs to be retrieved before executing the segment and then released. | ||||
|  Help us improve. Please let us know the company, where you were asked this question  : | ||||
|  Discuss  Correct / Improve   synchronized block   synchronized   synchronization   multithreading   threads   mutual exclusion   concurrency  Asked in 4 Companies  intermediate       frequent | ||||
|  Try 1 Question(s) Test | ||||
| 
 | ||||
| Ans. Continuous integration or CI is the practice, of merging all developer working copies to a shared mainline several times a day. | ||||
|  Help us improve. Please let us know the company, where you were asked this question  : | ||||
|  Discuss  Correct / Improve   continuous integration   jenkins  hudson   build tools | ||||
|  Must know at all levels. Among Top 10 frequently asked questions in Java. Very frequently asked to fresh graduates or less experienced professionals. | ||||
| 
 | ||||
| Ans. Its a facility for code reuse and independent extension wherein a derived class inherits the properties of parent class. | ||||
|  Help us improve. Please let us know the company, where you were asked this question  : | ||||
|  Discuss  Correct / Improve   inheritance  object oriented programming (oops)  oops concepts  oops concepts  java concepts  code reuse  code re-use   classes  derived classes  Asked in 14 Companies  basic       frequent | ||||
| 
 | ||||
| Ans. A Java bean is a class which abides by following conventions: Core of the object is member elements and not operations ( methods ) Member Elements can be accessed by getters (and setters if those properties are not read-only). serializable. | ||||
|  Help us improve. Please let us know the company, where you were asked this question  : | ||||
|  Discuss  Correct / Improve   java bean   javabean   pojo   classes  basic       frequent | ||||
| 
 | ||||
| Ans. http://www.geeksforgeeks.org/find-duplicates-in-on-time-and-constant-extra-space/ | ||||
|  Help us improve. Please let us know the company, where you were asked this question  : | ||||
|  Discuss  Correct / Improve   algorithm   program   code   coding  makemytrip.com | ||||
| 
 | ||||
| Ans. http://javasearch.buggybread.com/CodeSnippets/searchCodeSamples.php?keyword=Method+to+convert+all+elements+of+a+collection&category=code | ||||
|  Help us improve. Please let us know the company, where you were asked this question  : | ||||
|  Discuss  Correct / Improve   code  coding  string  String.toLowerCase  set  collections | ||||
| 
 | ||||
| Ans. http://javasearch.buggybread.com/CodeSnippets/searchCodeSamples.php?keyword=+Get+all+words+from+a+String&category=code | ||||
|  Help us improve. Please let us know the company, where you were asked this question  : | ||||
|  Discuss  Correct / Improve   string   get all words from strings   string.split | ||||
|  Recently asked in Sophos | ||||
| 
 | ||||
| Ans. http://javasearch.buggybread.com/CodeSnippets/searchCodeSamples.php?keyword=Method+to+get+a+map+of+words&category=code | ||||
|  Help us improve. Please let us know the company, where you were asked this question  : | ||||
|  Discuss  Correct / Improve   map  collections  Asked in 2 Companies  intermediate | ||||
| 
 | ||||
| Ans. http://javasearch.buggybread.com/CodeSnippets/searchCodeSamples.php?keyword=singleton+class&category=code | ||||
|  Help us improve. Please let us know the company, where you were asked this question  : | ||||
|  Discuss  Correct / Improve   singleton  code  coding  design pattern  Asked in 1 Companies  Intermediate       frequent | ||||
| 
 | ||||
| Ans. Yeah, I once looked into implementation of TreeSet and TreeMap just for learning. | ||||
|  Help us improve. Please let us know the company, where you were asked this question  : | ||||
|  Discuss  Correct / Improve   collections | ||||
| 
 | ||||
| Ans. Static polymorphism is the polymorphic resolution identified at compile time and is achieved through function overloading whereas dynamic polymorphism is the polymorphic resolution identified at runtime and is achieved through method overriding. | ||||
|  Help us improve. Please let us know the company, where you were asked this question  : | ||||
|  Discuss  Correct / Improve   static polymorphism  object oriented programming (oops)  oops concepts   dynamic polymorphism  object oriented programming (oops)  oops concepts   polymorphism  object oriented programming (oops)  oops concepts   overloading   overriding   broadridg  Asked in 1 Companies  basic       frequent | ||||
| 
 | ||||
| Ans. Abstract means that the class is only meant to be subclassed whereas final means that it cannot be subclassed so both concepts - abstract and final are actually mutually exclusive and hence not permitted together. | ||||
|  Help us improve. Please let us know the company, where you were asked this question  : | ||||
|  Discuss  Correct / Improve   abstract   final   java keywords  Asked in 1 Companies | ||||
|  Very frequently asked to fresh graduates. Frequently asked in NSEiT and Accenture India | ||||
| 
 | ||||
| Ans. public class Main { public static void main(String args[]) { int number = 2; int count = 0; long sum = 0; int givenNumber = 1000; while (count < givenNumber) { if (isPrimeNumber(number)) { sum = number; count; } number; } System.out.println(sum); } private static boolean isPrimeNumber(int number) { for (int i = 2; i <= number / 2; i) { if (number % i == 0) { return false; } } return true; } } | ||||
|  Help us improve. Please let us know the company, where you were asked this question  : | ||||
|  Discuss  Correct / Improve   generate prime numbers  code  coding  Asked in 5 Companies  basic       frequent | ||||
| 
 | ||||
| Ans. public class Factorial { public static void main(String[] args){ int x = 5; System.out.println(calculateFactorial(x)); } private static int calculateFactorial(int x){ if(x==1){ return 1; } return x * calculateFactorial(x-1); } } | ||||
|  Help us improve. Please let us know the company, where you were asked this question  : | ||||
|  Discuss  Correct / Improve   factorial  calculate factorial  code  coding  recursion  Asked in 1 Companies  basic | ||||
| 
 | ||||
| Ans. http://javasearch.buggybread.com/CodeSnippets/searchCodeSamples.php?&category=code&searchOption&keyword=964 | ||||
|  Help us improve. Please let us know the company, where you were asked this question  : | ||||
|  Discuss  Correct / Improve   builder design pattern  builder pattern  code  coding  intermediate | ||||
| 
 | ||||
| Ans. http://javasearch.buggybread.com/CodeSnippets/searchCodeSamples.php?&category=code&searchOption&keyword=965 | ||||
|  Help us improve. Please let us know the company, where you were asked this question  : | ||||
|  Discuss  Correct / Improve   constructor overloading  code  coding  Asked in 2 Companies  basic | ||||
| 
 | ||||
| Ans. http://javasearch.buggybread.com/CodeSnippets/searchCodeSamples.php?&category=code&searchOption&keyword=952 | ||||
|  Help us improve. Please let us know the company, where you were asked this question  : | ||||
|  Discuss  Correct / Improve   set  collections  sorting  treeset  code  coding | ||||
| 
 | ||||
| Ans. As Class B has been declared abstract , we can either implement any of these methods and just declare rest of them abstract. | ||||
|  Help us improve. Please let us know the company, where you were asked this question  : | ||||
|  Discuss  Correct / Improve   interfaces  abstract classes  code  coding | ||||
|  Try 2 Question(s) Test | ||||
| 
 | ||||
| Ans. false false | ||||
|  Help us improve. Please let us know the company, where you were asked this question  : | ||||
|  Discuss  Correct / Improve   object equality  code  coding       frequent | ||||
| 
 | ||||
| Ans. There was no multiple inheritance in java before version 8 as implementing multiple interfaces cannot be termed as inheritance. With Java 8 , came the concept of default methods wherein the class implementing the interface carries the default implementation from the interface and hence facilitating multiple inheritance. | ||||
|  Help us improve. Please let us know the company, where you were asked this question  : | ||||
|  Discuss  Correct / Improve   multiple inheritance  object oriented programming (oops)  oops concepts   inheritance  object oriented programming (oops)  oops concepts   oops concept  Asked in 10 Companies       frequent | ||||
| 
 | ||||
| Ans. http://javasearch.buggybread.com/CodeSnippets/searchCodeSamples.php?&category=code&searchOption&keyword=979 | ||||
|  Help us improve. Please let us know the company, where you were asked this question  : | ||||
|  Discuss  Correct / Improve   coin changer application  coin changing  general electic (ge) | ||||
| 
 | ||||
| Ans. It is an unmodifiable / read only view of the underlying collection. We can use Collections.unmodifiableSet(Set set) Collections.unmodifiableMap(Map map) Collections.unmodifiableCollection(Collection collection) | ||||
|  Help us improve. Please let us know the company, where you were asked this question  : | ||||
|  Discuss  Correct / Improve   collections  set  unmodifiable set  map  unmodifiable map  unmodifiablemap  unmodifiableset  Collections.unmodifiableCollection  Collections.unmodifiableMap  Collections.unmodifiableSet | ||||
| 
 | ||||
| Ans. MethodHandle is a modern, more flexible, more typesafe way of doing reflection. | ||||
|  Help us improve. Please let us know the company, where you were asked this question  : | ||||
|  Discuss  Correct / Improve   MethodHandle  Reflection | ||||
| 
 | ||||
| Ans. Destructor is used to de-allocate memory allocated by objects. There are no destructors in Java. Alternatively, Java provides Automatic garbage collection i.e automatically releasing the un-referenced memory. | ||||
|  Help us improve. Please let us know the company, where you were asked this question  : | ||||
|  Discuss  Correct / Improve   destructor  garbage collection  Asked in 11 Companies  Basic       frequent | ||||
|  Try 1 Question(s) Test | ||||
| 
 | ||||
| Ans. Scriptlet allow to write Java code inside JSP like following <% Java Code %> | ||||
|  Help us improve. Please let us know the company, where you were asked this question  : | ||||
|  Discuss  Correct / Improve   jsp  jsp scriptlet  scriptlet | ||||
|    | ||||