Java core learning path

Java developers preparing for interviews who want core language, JVM, collections, Hibernate and what-happens-if scenarios in order.

86 questions4 levels19 must‑knowFree, no account

Your progress

L1 · 0 of 34L2 · 0 of 29L3 · 0 of 19L4 · 0 of 4

Level 1 · 34 questions. Begin with what gets asked in the first ten minutes. Levels 2 to 4 build on it.

Start with Level 1
Level 1First ten minutesTwo-sentence answers to what gets asked first.34 questions · 8 topics

The Java platform

  1. 1.1What are the JDK, the JRE and the JVM, and how does Java code run?2 min

Object-oriented basics

  1. 2.1What are the four principles of object-oriented programming in Java?2 min
  2. 2.2What is the difference between method overloading and method overriding?1 min
  3. 2.3What is the difference between an interface and an abstract class?1 min
  4. 2.4What do the access modifiers and the static keyword mean?1 min
  5. 2.5Is Java pass-by-value or pass-by-reference?1 min

Objects, strings and numbers

  1. 3.1What is the difference between == and equals(), and why must hashCode() match equals()?2 min
  2. 3.2Why is String immutable, and when do you use StringBuilder or StringBuffer?2 min
  3. 3.3What is the difference between primitives and wrapper classes, and what is autoboxing?2 min
  4. 3.4What is the difference between final, finally and finalize?2 min

Exceptions and collections

  1. 4.1What is the difference between checked and unchecked exceptions?1 min
  2. 4.2How do try-catch-finally and try-with-resources work?1 min
  3. 4.3What are the main collection types, List, Set, Map and Queue, and when do you use each?1 min
  4. 4.4What is the difference between Comparable and Comparator?1 min

Java 8 language basics

  1. 5.1What are functional interfaces and lambdas?Must‑know2 min
  2. 5.2What is the difference between map() and flatMap()?Must‑know1 min
  3. 5.3How does Optional help avoid null checks?Must‑know1 min
  4. 5.4What is the difference between default and static methods in interfaces?1 min
  5. 5.5What is the difference between Thread, Runnable and Callable?Must‑know2 min

Java 9 to 17 language features

  1. 6.1What is the difference between List.of() and Arrays.asList()?1 min
  2. 6.2Why were private interface methods added?1 min
  3. 6.3What is var and where can you use it?1 min
  4. 6.4Which new String methods came in Java 11?1 min
  5. 6.5What are switch expressions?1 min
  6. 6.6What are text blocks?1 min
  7. 6.7What are records and when should you use them?Must‑know4 min
  8. 6.8What is pattern matching for instanceof?1 min
  9. 6.9What are sequenced collections?1 min

Everyday pitfalls

  1. 7.1Two Employee objects with identical data compared; equals() never overridden?Must‑know1 min
  2. 7.2filter then findAny then get finds no match — null or exception?1 min
  3. 7.3Word count with Collectors.toMap mapping each word to 1, and a word repeats?Must‑know1 min
  4. 7.4collect invoked twice on the same stream?1 min
  5. 7.5Component removed from a class another bean Autowires?1 min

Hibernate entity states

  1. 8.1What states can a Hibernate entity be in, and what exactly does each one mean?Must‑know3 min
Level 2Daily jobWhat you use at work every week.29 questions · 6 topics

Streams, futures and newer language features

  1. 1.1What is lazy evaluation in streams?1 min
  2. 1.2What is the difference between Future and CompletableFuture?Must‑know3 min
  3. 1.3What are sealed classes?2 min
  4. 1.4How is a record different from a traditional class?1 min
  5. 1.5What are virtual threads?Must‑know2 min
  6. 1.6How do virtual threads differ from platform threads?3 min
  7. 1.7What is pattern matching for switch?1 min

Concurrency and the JVM

  1. 2.1What is the difference between synchronized and ReentrantLock?Must‑know8 min
  2. 2.2What is the difference between volatile and AtomicInteger?Must‑know5 min
  3. 2.3A fixed thread pool of 3 threads gets 10 tasks. How do they run?4 min
  4. 2.4What are deadlock, starvation, livelock and race conditions?Must‑know4 min
  5. 2.5How does garbage collection work in the JVM?Must‑know1 min
  6. 2.6What are the JVM memory areas?Must‑know1 min
  7. 2.7How does the String pool work, and how many objects does new String create?3 min
  8. 2.8What is a ThreadLocal and how does it work?9 min

Concurrency and API design scenarios

  1. 3.1Thread 1 locks A then B; thread 2 locks B then A, concurrently?Must‑know1 min
  2. 3.2Two threads print 1–100 (odd/even) with no synchronization?2 min
  3. 3.3New payment method added; PaymentService is a giant if-else on type?1 min
  4. 3.4Stream.concat of two lists then sorted, and one list contains null?1 min
  5. 3.5Two people book the same seat at the same moment. How do you make sure only one gets it?Must‑know3 min

Database and JPA scenarios

  1. 4.1API loads one hundred thousand rows and returns them in one response?2 min
  2. 4.2Fetch one hundred orders, call getItems on each?Must‑know1 min
  3. 4.3Two employees tie for top salary; second highest via ORDER BY salary DESC LIMIT 1 OFFSET 1?3 min
  4. 4.4LEFT JOIN orders, then WHERE order status equals PAID?Must‑know1 min
  5. 4.5Request fails three services deep, independent logs, no correlation ID?3 min

Hibernate persistence

  1. 5.1Which operations move an entity between these four states?5 min
  2. 5.2What is the difference between removed and deleted?2 min
  3. 5.3In Spring Boot, what state is an entity in after a @Transactional method commits?4 min

Collections coding

  1. 6.1How do you return the k most frequent numbers, with the larger number first on a tie?3 min
Level 3SeniorProduction trade-offs and failure modes.19 questions · 4 topics

Modules and Java 21 concurrency

  1. 1.1What is JPMS, the Java module system?1 min
  2. 1.2What JVM and platform improvements do you get by moving to Java 17?2 min
  3. 1.3How do virtual threads improve scalability?1 min
  4. 1.4What is structured concurrency?1 min
  5. 1.5What are scoped values?1 min
  6. 1.6What is the difference between ExecutorService and ForkJoinPool?2 min
  7. 1.7What are strong, soft, weak and phantom references, and when can the GC collect each?8 min

Production troubleshooting

  1. 2.1How do you troubleshoot high CPU in a Java service?3 min
  2. 2.2How do you investigate frequent GC pauses?5 min
  3. 2.3How do you optimize memory usage in a Java application?3 min
  4. 2.4How would you handle thousands of concurrent API requests?3 min
  5. 2.5How would you migrate an application from Java 8 to Java 21?2 min

Spring, JPA and distributed scenarios

  1. 3.1Transactional method writes a file, then the DB update fails?1 min
  2. 3.2Service calls an external API with no timeout and the API hangs?2 min
  3. 3.3Controller returns a JPA entity with a lazy OneToMany?2 min
  4. 3.4Remove the API gateway; frontend calls all six services directly?1 min
  5. 3.5Kafka consumer crashes after processing but before committing the offset?2 min
  6. 3.6User logs out but their JWT has not expired?2 min

Build a HashMap

  1. 4.1How do you implement your own HashMap?4 min
Level 4InternalsHow it works underneath, and at scale.4 questions · 1 topics