Java core learning path
Java developers preparing for interviews who want core language, JVM, collections, Hibernate and what-happens-if scenarios in order.
Your progress
L1 · 0 of 34L2 · 0 of 29L3 · 0 of 19L4 · 0 of 4
Next
Level 1 · 34 questions. Begin with what gets asked in the first ten minutes. Levels 2 to 4 build on it.
Level 1First ten minutesTwo-sentence answers to what gets asked first.
The Java platform
- 1.1What are the JDK, the JRE and the JVM, and how does Java code run?Review againNext2 min
Object-oriented basics
- 2.1What are the four principles of object-oriented programming in Java?Review againNext2 min
- 2.2What is the difference between method overloading and method overriding?Review againNext1 min
- 2.3What is the difference between an interface and an abstract class?Review againNext1 min
- 2.4What do the access modifiers and the static keyword mean?Review againNext1 min
- 2.5Is Java pass-by-value or pass-by-reference?Review againNext1 min
Objects, strings and numbers
- 3.1What is the difference between == and equals(), and why must hashCode() match equals()?Review againNext2 min
- 3.2Why is String immutable, and when do you use StringBuilder or StringBuffer?Review againNext2 min
- 3.3What is the difference between primitives and wrapper classes, and what is autoboxing?Review againNext2 min
- 3.4What is the difference between final, finally and finalize?Review againNext2 min
Exceptions and collections
- 4.1What is the difference between checked and unchecked exceptions?Review againNext1 min
- 4.2How do try-catch-finally and try-with-resources work?Review againNext1 min
- 4.3What are the main collection types, List, Set, Map and Queue, and when do you use each?Review againNext1 min
- 4.4What is the difference between Comparable and Comparator?Review againNext1 min
Java 8 language basics
- 5.1What are functional interfaces and lambdas?Must‑knowReview againNext2 min
- 5.2What is the difference between map() and flatMap()?Must‑knowReview againNext1 min
- 5.3How does Optional help avoid null checks?Must‑knowReview againNext1 min
- 5.4What is the difference between default and static methods in interfaces?Review againNext1 min
- 5.5What is the difference between Thread, Runnable and Callable?Must‑knowReview againNext2 min
Java 9 to 17 language features
- 6.1What is the difference between List.of() and Arrays.asList()?Review againNext1 min
- 6.2Why were private interface methods added?Review againNext1 min
- 6.3What is var and where can you use it?Review againNext1 min
- 6.4Which new String methods came in Java 11?Review againNext1 min
- 6.5What are switch expressions?Review againNext1 min
- 6.6What are text blocks?Review againNext1 min
- 6.7What are records and when should you use them?Must‑knowReview againNext4 min
- 6.8What is pattern matching for instanceof?Review againNext1 min
- 6.9What are sequenced collections?Review againNext1 min
Everyday pitfalls
- 7.1Two Employee objects with identical data compared; equals() never overridden?Must‑knowReview againNext1 min
- 7.2filter then findAny then get finds no match — null or exception?Review againNext1 min
- 7.3Word count with Collectors.toMap mapping each word to 1, and a word repeats?Must‑knowReview againNext1 min
- 7.4collect invoked twice on the same stream?Review againNext1 min
- 7.5Component removed from a class another bean Autowires?Review againNext1 min
Hibernate entity states
- 8.1What states can a Hibernate entity be in, and what exactly does each one mean?Must‑knowReview againNext3 min
Level 2Daily jobWhat you use at work every week.
Streams, futures and newer language features
- 1.1What is lazy evaluation in streams?Review againNext1 min
- 1.2What is the difference between Future and CompletableFuture?Must‑knowReview againNext3 min
- 1.3What are sealed classes?Review againNext2 min
- 1.4How is a record different from a traditional class?Review againNext1 min
- 1.5What are virtual threads?Must‑knowReview againNext2 min
- 1.6How do virtual threads differ from platform threads?Review againNext3 min
- 1.7What is pattern matching for switch?Review againNext1 min
Concurrency and the JVM
- 2.1What is the difference between synchronized and ReentrantLock?Must‑knowReview againNext8 min
- 2.2What is the difference between volatile and AtomicInteger?Must‑knowReview againNext5 min
- 2.3A fixed thread pool of 3 threads gets 10 tasks. How do they run?Review againNext4 min
- 2.4What are deadlock, starvation, livelock and race conditions?Must‑knowReview againNext4 min
- 2.5How does garbage collection work in the JVM?Must‑knowReview againNext1 min
- 2.6What are the JVM memory areas?Must‑knowReview againNext1 min
- 2.7How does the String pool work, and how many objects does new String create?Review againNext3 min
- 2.8What is a ThreadLocal and how does it work?Review againNext9 min
Concurrency and API design scenarios
- 3.1Thread 1 locks A then B; thread 2 locks B then A, concurrently?Must‑knowReview againNext1 min
- 3.2Two threads print 1–100 (odd/even) with no synchronization?Review againNext2 min
- 3.3New payment method added; PaymentService is a giant if-else on type?Review againNext1 min
- 3.4Stream.concat of two lists then sorted, and one list contains null?Review againNext1 min
- 3.5Two people book the same seat at the same moment. How do you make sure only one gets it?Must‑knowReview againNext3 min
Database and JPA scenarios
- 4.1API loads one hundred thousand rows and returns them in one response?Review againNext2 min
- 4.2Fetch one hundred orders, call getItems on each?Must‑knowReview againNext1 min
- 4.3Two employees tie for top salary; second highest via ORDER BY salary DESC LIMIT 1 OFFSET 1?Review againNext3 min
- 4.4LEFT JOIN orders, then WHERE order status equals PAID?Must‑knowReview againNext1 min
- 4.5Request fails three services deep, independent logs, no correlation ID?Review againNext3 min
Hibernate persistence
- 5.1Which operations move an entity between these four states?Review againNext5 min
- 5.2What is the difference between removed and deleted?Review againNext2 min
- 5.3In Spring Boot, what state is an entity in after a @Transactional method commits?Review againNext4 min
Collections coding
Level 3SeniorProduction trade-offs and failure modes.
Modules and Java 21 concurrency
- 1.1What is JPMS, the Java module system?Review againNext1 min
- 1.2What JVM and platform improvements do you get by moving to Java 17?Review againNext2 min
- 1.3How do virtual threads improve scalability?Review againNext1 min
- 1.4What is structured concurrency?Review againNext1 min
- 1.5What are scoped values?Review againNext1 min
- 1.6What is the difference between ExecutorService and ForkJoinPool?Review againNext2 min
- 1.7What are strong, soft, weak and phantom references, and when can the GC collect each?Review againNext8 min
Production troubleshooting
- 2.1How do you troubleshoot high CPU in a Java service?Review againNext3 min
- 2.2How do you investigate frequent GC pauses?Review againNext5 min
- 2.3How do you optimize memory usage in a Java application?Review againNext3 min
- 2.4How would you handle thousands of concurrent API requests?Review againNext3 min
- 2.5How would you migrate an application from Java 8 to Java 21?Review againNext2 min
Spring, JPA and distributed scenarios
- 3.1Transactional method writes a file, then the DB update fails?Review againNext1 min
- 3.2Service calls an external API with no timeout and the API hangs?Review againNext2 min
- 3.3Controller returns a JPA entity with a lazy OneToMany?Review againNext2 min
- 3.4Remove the API gateway; frontend calls all six services directly?Review againNext1 min
- 3.5Kafka consumer crashes after processing but before committing the offset?Review againNext2 min
- 3.6User logs out but their JWT has not expired?Review againNext2 min
Build a HashMap
- 4.1How do you implement your own HashMap?Review againNext4 min
Level 4InternalsHow it works underneath, and at scale.
JDK internals
- 1.1How does the Stream API work internally?Review againNext1 min
- 1.2How does ConcurrentHashMap work internally?Review againNext3 min
- 1.3How do G1 and ZGC compare?Review againNext1 min
- 1.4What is Generational ZGC?Review againNext1 min
Each card is a topic. Columns go from Level 1 to Level 4; the outlined card is where you are.