Top 21 Frequently Asked Java Interview Questions Answers

If you have been to couple of Java interviews then you know that there are some questions which keep repeating e.g. difference between == and equals() method and may of it's popular cousins like HashMap vs Hashtable, ArrayList vs LinkedList, difference between equals() and hashCode(), or difference between Comparator and Comparable in Java. I call them frequently asked Java interview questions, and I suggest every Java developer to make a list of them for their own reference and revision. I am sure many Java programmer already has such list of questions handy, if not this is a good time to find and make your own list. These are the questions which you simply can't afford to miss, especially at freshers level. They appear at various stage of Java interviews. Most likely you will see them on telephonic round, where Interviewer just want to filter candidates between who knows Java and who doesn't.

QuickSort Example in Java using Recursion - Sorting Algorithm Implementation

Quicksort is one of the very popular sorting algorithms in programming, often used to sort a large list of numbers. Though their are numerous algorithm available to sort list of objects, including integer, string and floating point number, quicksort is best for general purpose. It's a divide and conquer algorithm, where we divide the given array with respect to a particular element, known as 'pivot' such that the lower partition of the array are less than the pivot and upper partition elements of the array are higher than the pivot. Quicksort is also one of the best example of recursion. It's naturally recursive, because it sort the large list by dividing into smaller sub-list and then applying same algorithm on those.