Java Interview Questions
OOP, collections, multithreading, JVM internals, exceptions, generics and Java 8 streams.
61 questions
Popular Searches
1. What is Java and What are its Features?
easyFundamentals 6 mins2. Difference Between JVM, JRE and JDK
easyFundamentals 6 mins3. What are the OOP Concepts in Java?
easyOOP 7 mins4. How Does Inheritance Work in Java?
mediumOOP 7 mins5. What is Polymorphism in Java?
mediumOOP 7 mins6. What is Encapsulation in Java?
easyOOP 6 mins7. What is Abstraction in Java?
easyOOP 5 mins8. Interface vs Abstract Class in Java
mediumOOP 6 mins9. Method Overloading vs Overriding in Java
mediumOOP 6 mins10. Why are Strings Immutable in Java?
mediumCore 6 mins11. String vs StringBuilder vs StringBuffer
mediumCore 6 mins12. Checked vs Unchecked Exceptions in Java
mediumExceptions 6 mins13. What is the Java Collections Framework?
mediumCollections 6 mins14. ArrayList vs LinkedList in Java
mediumCollections 6 mins15. How Does HashMap Work Internally in Java?
hardCollections 7 mins16. HashMap vs Hashtable in Java
mediumCollections 6 mins17. equals() vs hashCode() in Java
mediumCore 6 mins18. Difference Between final, finally and finalize
mediumCore 6 mins19. What is the static Keyword in Java?
easyCore 6 mins20. this vs super Keyword in Java
easyOOP 6 mins21. How Does Garbage Collection Work in Java?
hardMemory 8 mins22. What is Multithreading in Java?
mediumConcurrency 6 mins23. What is the Thread Lifecycle in Java?
mediumConcurrency 6 mins24. What is the synchronized Keyword in Java?
hardConcurrency 7 mins25. Runnable vs Thread in Java
mediumConcurrency 6 mins26. Comparable vs Comparator in Java
mediumCollections 6 mins27. What are Generics in Java?
mediumCore 7 mins28. What are Streams in Java 8?
mediumJava 8 6 mins29. What are Functional Interfaces in Java?
mediumJava 8 6 mins30. What is Autoboxing and Unboxing in Java?
easyCore 5 mins31. JDK vs JRE vs JVM: What's the Difference?
easyFundamentals 5 mins32. What is Object-Oriented Programming (OOP) in Java?
easyFundamentals 6 mins33. What are Java Data Types?
easyFundamentals 5 mins34. What is the Java Collections Framework?
mediumCollections 7 mins35. What is a Constructor in Java?
mediumOOP 6 mins36. What is the final Keyword in Java?
mediumLanguage Features 6 mins37. What is a Java Thread?
hardConcurrency 8 mins38. String vs StringBuilder: What's the Difference?
hardCore Classes 7 mins39. What is Autoboxing in Java?
hardLanguage Features 7 mins40. What are Generics in Java?
hardLanguage Features 8 mins41. What is a lambda expression in Java?
hardFunctional Programming 6 mins42. What is the Stream API in Java?
hardCollections & Streams 6 mins43. What is the Java Memory Model and what does happens-before actually guarantee?
hardConcurrency 9 mins44. How do you choose between Java's garbage collectors, and what are the trade-offs?
hardJVM Internals 9 mins45. What is the difference between ClassNotFoundException and NoClassDefFoundError?
mediumJVM Internals 8 mins46. How does class loading work in Java, and what is parent delegation?
hardJVM Internals 9 mins47. What are virtual threads, and how do they differ from platform threads?
hardConcurrency 9 mins48. How do you compose asynchronous work with CompletableFuture without blocking?
hardConcurrency 9 mins49. What goes wrong in HashMap and HashSet when equals and hashCode are implemented badly?
hardCollections 9 mins50. How does laziness work in Java streams, and when does a stream do no work at all?
mediumStreams 8 mins51. When is parallelStream a bad idea, and what goes wrong in production?
hardStreams 9 mins52. What are records in Java, and where should you not use one?
mediumLanguage Features 8 mins53. What problem do sealed classes and interfaces solve in Java?
mediumLanguage Features 8 mins54. How does ThreadLocal cause memory leaks, and how do you use it safely?
hardMemory Management 9 mins55. What are the risks of Java's built-in serialization, and what should you use instead?
hardSecurity 9 mins56. Why are naive Java microbenchmarks wrong, and what does JIT warmup change?
hardPerformance 9 mins57. ConcurrentHashMap is thread-safe, so why can code using it still be racy?
hardConcurrency 9 mins58. How do you make a Java class genuinely immutable, and where do defensive copies matter?
mediumDesign 8 mins59. How does try-with-resources work, and what are suppressed exceptions?
mediumException Handling 8 mins60. How do you diagnose the different kinds of OutOfMemoryError in a Java service?
hardMemory Management 9 mins61. When do you use an atomic class rather than volatile or a lock?
hardConcurrency 9 mins