Core Java & Collections Interview Questions
String pool, equals and hashCode, HashMap internals, collections, JVM memory, GC, threads, and Java 8+ streams.
30 questions in this section
- JDK vs JRE vs JVM and Platform Independence (Beginner)
- String Immutability and the String Pool (Beginner)
- String vs StringBuilder vs StringBuffer (Beginner)
- == vs equals() and the hashCode Contract (Beginner)
- final vs finally vs finalize (Beginner)
- The static Keyword: Variables, Methods, Blocks and Nested Classes (Beginner)
- Wrapper Classes, Autoboxing and the Integer Cache (Beginner)
- Checked vs Unchecked Exceptions (Beginner)
- try-with-resources and AutoCloseable (Intermediate)
- The Java Collections Framework Hierarchy (Beginner)
- ArrayList vs LinkedList (Intermediate)
- How HashMap Works Internally (Advanced)
- HashMap vs Hashtable vs ConcurrentHashMap (Advanced)
- How HashSet Works Internally (Intermediate)
- Comparable vs Comparator and How TreeMap Sorts (Intermediate)
- Fail-Fast vs Fail-Safe Iterators (Intermediate)
- Generics, Wildcards and Type Erasure (Advanced)
- JVM Memory: Heap, Stack, Metaspace (Intermediate)
- Garbage Collection Basics and GC Roots (Advanced)
- Thread vs Runnable and the Thread Lifecycle (Beginner)
- synchronized vs volatile: Visibility, Atomicity and Ordering (Advanced)
- wait(), notify() and the Producer-Consumer Pattern (Intermediate)
- Deadlock: Conditions, Detection and Prevention (Advanced)
- ExecutorService, Thread Pools and Future (Intermediate)
- Lambdas, Functional Interfaces and Method References (Intermediate)
- Streams API: Pipelines, Laziness and Collectors (Intermediate)
- Optional: Purpose, Usage and Anti-Patterns (Intermediate)
- Records in Java: Concise Immutable Data Carriers (Intermediate)
- Tricky Output Questions: Types, Overflow and Overloading (Intermediate)
- Tricky Output: finally Overrides and Initialization Order (Advanced)