This list is not exhaustive as of now but I would like to keep this list updated as and when I come across some interesting questions.
- What is equals() and What is its significance to java.util.collection package?
- What is hashCode() and what is its significance to java.util.collection package?
- If equals() is implemented is it must to implement hasCode().Why?
- If hashCode() is implemented is it must to implement equals().Why?
- Does String class implements equals() and hasCode()?
- If you were to write the implementation of String classes equals() what would it be?
- Can equals() and hasCode() be modified using Java's Generics?
- Why do we have Collections data structure when we can make use of ordinary arrays?
- What is the difference between Array and ArrayList?
- What is the difference between ArrayList and Vector?
- What is the difference between (ArrayList,Vector) and LinkedList?
- What are the pros and cons of using an ArrayList?
- What are the pros and cons of using a Vector?
- What are the pros and cons of using a LinkedList?
- What is hashing?
- What is the difference between HashSet and LinkedHashSet?
- What is TreeSet and how is it different from hash based Set's?
- What is the difference between Comparable and Comparator?
- What is the significance of Comparable and Comparator to Tree based data structures?
- Which data structure will you use when you want to order a list of song's by either the singer or the name of the song.Show me the implementation?
- Which data structure will you use when you want a fast search?
- What is collision in hash based data structures.
- Can you write a simple program to show how hashing works?
- Write a code to implement a LinkedList.
- Write a code to implement a Stack.Also make sure that when multiple threads are pushing elements onto the stack no elements being pushed are lost.
- What are different ways of implementing Threads in java and which would you recommend?
- What is object locking?
- What is Class locking?
- Consider that are 2 synchronized instance (A1() and A2()) and 2 synchronized static (B1 and B2) methods in a class Sample.Now answer the following -
a] If one thread say T1 is executing A1() of an object obj1 of class Sample, can another thread say T2 execute A2() of obj1?
b] If one thread say T1 is executing A1() of an object obj1 of class Sample, can another thread say T2 execute B1() of obj1?
c] If one thread say T1 is executing B1() of an object obj1 of class Sample, can another thread say T2 execute B2() of obj1?
d] If one thread say T1 is executing A1() of an object obj1 of class Sample, can another thread say T2 execute B2() of another object obj2 of class Sample?
e] If one thread say T1 is executing B1() of an object obj1 of class Sample, can another thread say T2 execute B2() of another object obj2 of class Sample? - What is final,finalize and finally?
- What is the solution to an outofmemory error?
- What is Singleton?
- What is Factory method pattern?
- What is abstract factory pattern?
Algorithm and Data Structures -
1] Write a bubble sort algorithm and its time complexity?
2] What is insertion sort and selection sort ?
3] Which of bubble , selection & insertion sorts time complexity is the best in best case?
4] What is Merge sort and how is its time complexity computed?
5] What is Binary search & its time complexity ?
No comments:
Post a Comment