โ† All topics

โ˜• Interview Prep

Java

equals and hashCode, collections internals, strings, exceptions, generics, streams, concurrency, the JVM and modern Java: what Java and Spring teams test.

๐Ÿ“˜ Learn it from scratch

Visual, hands-on lessons for every pattern in this topic. Do the lesson, then come back and the questions click.

100 questions, most asked first

Ranked by how often each question comes up in real interviews. #1 is the most common.

#3String immutability, the string pool, and == vs equalsCore Java & OOPEasyFree#4Abstract class vs interfaceCore Java & OOPEasyFree#5ArrayList vs LinkedListCollectionsEasyFree#6final vs finally vs finalizeCore Java & OOPEasyFree#8JDK vs JRE vs JVMJVM & memoryEasyFree#10Overloading vs overridingCore Java & OOPEasyFreeUnlock 24 more Java questions ยท all 1,200 questions for $39/year (about 11ยข a day)See full access#11String vs StringBuilder vs StringBufferCore Java & OOPEasy๐Ÿ”’#12What does static mean?Core Java & OOPEasy๐Ÿ”’#13Comparable vs ComparatorCollectionsEasy๐Ÿ”’#21Is Java pass-by-value or pass-by-reference?Core Java & OOPEasy๐Ÿ”’#23try-with-resources and AutoCloseableExceptionsEasy๐Ÿ”’#24HashSet vs LinkedHashSet vs TreeSetCollectionsEasy๐Ÿ”’#26public, protected, package-private and privateCore Java & OOPEasy๐Ÿ”’#29What are records, and when should you use them?Modern JavaEasy๐Ÿ”’#32HashMap vs LinkedHashMap vs TreeMapCollectionsEasy๐Ÿ”’#36Thread lifecycle and statesConcurrencyEasy๐Ÿ”’#41Polymorphism and dynamic dispatchCore Java & OOPEasy๐Ÿ”’#54Enums are full classesCore Java & OOPEasy๐Ÿ”’#62Integer overflow and numeric typesCore Java & OOPEasy๐Ÿ”’#63Why not use double for money?Core Java & OOPEasy๐Ÿ”’#64Local variable type inference with varModern JavaEasy๐Ÿ”’#70The Builder patternCore Java & OOPEasy๐Ÿ”’#77Maven vs Gradle and dependency managementSpring & ecosystemEasy๐Ÿ”’#80Configuration and profiles in Spring BootSpring & ecosystemEasy๐Ÿ”’#84String.split surprisesCore Java & OOPEasy๐Ÿ”’#87Method referencesStreams & lambdasEasy๐Ÿ”’#89Why use ArrayDeque instead of Stack?CollectionsEasy๐Ÿ”’#97Logging well in Java servicesSpring & ecosystemEasy๐Ÿ”’#98Handling null and NullPointerExceptionCore Java & OOPEasy๐Ÿ”’#99EnumMap and EnumSetCollectionsEasy๐Ÿ”’