Skip to content
Sharp

Java Interview Questions interview questions

Collections • ArrayDeque as a Queue, Collections • ArrayDeque as a Stack, Collections • ArrayList vs LinkedList, Collections • Comparable vs Comparator, Collections • HashMap Internals, Collections • HashSet Membership and Deduplication

400 questions with answers and explanations

Questions (page 1 of 8)

  1. When should a Java developer choose ArrayDeque as a Stack deliberately?Multiple choiceMedium
  2. When should a Java developer choose TreeSet and NavigableSet deliberately?Multiple choiceMedium
  3. In Java, which comparison about ExecutorService, Future, and CompletableFuture is accurate?Multiple choiceEasy
  4. Which practice avoids a common mistake with Java Memory Model, volatile, and synchronized?Multiple choiceMedium
  5. When should a Java developer choose ConcurrentSkipListMap deliberately?Multiple choiceMedium
  6. In Java, which comparison about ArrayList vs LinkedList is accurate?Multiple choiceEasy
  7. What deeper point about ArrayList vs LinkedList should a senior Java developer mention?Multiple choiceHard
  8. Which practice avoids a common mistake with equals() vs ==?Multiple choiceMedium
  9. What deeper point about CopyOnWriteArrayList should a senior Java developer mention?Multiple choiceHard
  10. Which statement about CopyOnWriteArrayList is the strongest interview answer?Multiple choiceEasy
  11. What deeper point about Thread Lifecycle and Creation should a senior Java developer mention?Multiple choiceHard
  12. Which practice avoids a common mistake with CopyOnWriteArrayList?Multiple choiceMedium
  13. What deeper point about ConcurrentSkipListMap should a senior Java developer mention?Multiple choiceHard
  14. When should a Java developer choose ArrayList vs LinkedList deliberately?Multiple choiceMedium
  15. In Java, which comparison about TreeSet and NavigableSet is accurate?Multiple choiceEasy
  16. When should a Java developer choose ConcurrentLinkedQueue deliberately?Multiple choiceMedium
  17. In Java, which comparison about List, Set, and Map is accurate?Multiple choiceEasy
  18. Which practice avoids a common mistake with ExecutorService, Future, and CompletableFuture?Multiple choiceMedium
  19. When should a Java developer choose HashMap Internals deliberately?Multiple choiceMedium
  20. In Java, which comparison about TreeMap and NavigableMap is accurate?Multiple choiceEasy
  21. Which practice avoids a common mistake with ArrayDeque as a Stack?Multiple choiceMedium
  22. Which practice avoids a common mistake with HashSet Membership and Deduplication?Multiple choiceMedium
  23. Which statement about Primitive Types and Wrappers is the strongest interview answer?Multiple choiceEasy
  24. In Java, which comparison about Immutable Class Design is accurate?Multiple choiceEasy
  25. Which statement about HashMap Internals is the strongest interview answer?Multiple choiceEasy
  26. Which practice avoids a common mistake with Immutable Class Design?Multiple choiceMedium
  27. When should a Java developer choose ArrayDeque as a Queue deliberately?Multiple choiceMedium
  28. Which practice avoids a common mistake with LinkedHashMap and Iteration Order?Multiple choiceMedium
  29. When should a Java developer choose Immutable Class Design deliberately?Multiple choiceMedium
  30. Which practice avoids a common mistake with List, Set, and Map?Multiple choiceMedium
  31. In Java, which comparison about ConcurrentHashMap and Concurrent Collections is accurate?Multiple choiceEasy
  32. Which statement about HashSet Membership and Deduplication is the strongest interview answer?Multiple choiceEasy
  33. In Java, which comparison about Comparable vs Comparator is accurate?Multiple choiceEasy
  34. Which practice avoids a common mistake with equals() and hashCode() Contract?Multiple choiceMedium
  35. Which practice avoids a common mistake with ArrayList vs LinkedList?Multiple choiceMedium
  36. Which practice avoids a common mistake with ConcurrentSkipListMap?Multiple choiceMedium
  37. Which statement about List, Set, and Map is the strongest interview answer?Multiple choiceEasy
  38. Which practice avoids a common mistake with TreeMap and NavigableMap?Multiple choiceMedium
  39. What deeper point about BlockingQueue and Producer-Consumer should a senior Java developer mention?Multiple choiceHard
  40. What deeper point about PriorityQueue and Heap Basics should a senior Java developer mention?Multiple choiceHard
  41. What deeper point about TreeMap and NavigableMap should a senior Java developer mention?Multiple choiceHard
  42. In Java, which comparison about Deadlocks and Race Conditions is accurate?Multiple choiceEasy
  43. Which statement about HashSet vs TreeSet is the strongest interview answer?Multiple choiceEasy
  44. Which practice avoids a common mistake with LRU Cache with LinkedHashMap?Multiple choiceMedium
  45. In Java, which comparison about Primitive Types and Wrappers is accurate?Multiple choiceEasy
  46. What deeper point about HashMap Internals should a senior Java developer mention?Multiple choiceHard
  47. When should a Java developer choose ExecutorService, Future, and CompletableFuture deliberately?Multiple choiceMedium
  48. What deeper point about Immutable Class Design should a senior Java developer mention?Multiple choiceHard
  49. Which statement about Immutable Class Design is the strongest interview answer?Multiple choiceEasy
  50. When should a Java developer choose Thread Lifecycle and Creation deliberately?Multiple choiceMedium