Skip to content

Instantly share code, notes, and snippets.

@vengateshm
Last active November 7, 2023 05:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vengateshm/b39d39526fcf25c447469cbb66b725da to your computer and use it in GitHub Desktop.
Save vengateshm/b39d39526fcf25c447469cbb66b725da to your computer and use it in GitHub Desktop.
Core Java Interview questions
  1. OOPs concepts Encapsulation, Abstraction, Inheritance, Polymorphism and explain
  2. Exception hierarchy in inheritance
  3. Parent child override scenario
  4. Can we override static and private method?
  5. Difference between Java 7 and Java 8 interface (static methods and default methods introduced)
  6. Final, Finally, Finalize
  7. Equals and hashcode
  8. Why checked exception also called compile time exception, is it occurs in compile time?
  9. How to write custom exception?
  10. Throw and throws exception
  11. Exception order
  12. return usage in try, catch and finally block
  13. Ss finally block always executed?
  14. How many ways we can create string object?
  15. String constant pool and working of it
  16. Why string is immutable?
  17. String vs StringBuffer vs StringBUilder
  18. How to write your own custom immutable class?
  19. Which is good to store passwords char array or string?
  20. What is marker interface? (Serializable, Cloneable, Remote) and how and when it works?
  21. Collections - List(ArrayList, LinkedList), Set(HashSet, LinkedHashSet, TreeSet), Map(HashMap, LinkedHashMap, TreeMap)
  22. Concurrent - CopyOnWriteArrayList, CopyOnWriteArraySet, ConcurrentHashMap
  23. List vs Set
  24. ArrayList vs LinkedList
  25. Custom array list without duplicates (extend array list and override add method)
  26. ArrayList al = new ArrayList(); vs List l = new ArrayList<>();
  27. Declaring list with final keyword
  28. Why set does not allow duplicates?
  29. Comparable vs Comparator
  30. Fail fast vs fail safe iterator
  31. HashMap vs ConcurrentHashMap
  32. HashTable vs ConcurrentHashMap
  33. Collections.synchronizedMap() - HashTable implementation - Entired data structure is locked
  34. Internal working of HashMap - hash, bucket index, equals check, Linked List, Load factor, Balanced tree
  35. Null key hashmap - 0th index bucket
  36. TreeMap working
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment