Core Java Interview Questions

Here is the list of Java interview questions generally being asked these days. I'll sort these questions topic wise later.

Comparison based questions:

  1. Abstraction vs Encapsulation
  2. Composition vs Aggregation 
  3. Array List vs Linked List
  4. Abstract Class vs Interface
  5. Singleton Class vs Static variable
  6. Comparator vs Comparable
  7. Sleep vs Wait
  8. ClassNotFound vs NoClassDefinitionFound
  9. Exception vs Error
  10. List Iterator vs Iterator
  11. Iterator vs For loop
  12. For each vs For loop
  13. StringBuilder vs StringBuffer
  14. HashMap vs HashTable
  15. HashSet vs ArrayList
  16. Serialization vs Externalization
  17. JVM vs JDK vs JRE
  18. java.util collection vs java.util.concurrent collection.
  19. Arrays vs Collections class.

Elaboration Questions:

  1. Explain Serialization
  2. Use of serialization
  3. Explain JVM memory model
  4. Explain different states of Thread
  5. Explain Array List growth policy
  6. Explain Polymorphism
  7. Why Java does not allow multiple class inheritance
  8. Is it possible to catch Errors in catch block?

Write a program:

  1. Write a utility function to swap to strings. The function should take two String parameters and swap them. The swapped result should be visible to the function from which utility was called.
  2. Write Singleton Class implementation.
  3. Write an Immutable Class.
  4. Write a function to reverse the given String.

No comments: