Learning roadmap

A guided path from fundamentals to advanced — work through each stage in order.

1
Why is Java not considered a purely Object-Oriented language?What is the difference between Minor GC, Major GC, and Full GC?What is the difference between JDK, JRE, and JVM?What are the different types of inner classes in Java — member, static nested, local, and anonymous?How does a Java program actually run, from source file to execution?Explain the 4 pillars of OOP with real-world examples.What is an OutOfMemoryError vs StackOverflowError?What is the difference between a static nested class and a (non-static) inner class in Java?What is the difference between == and .equals() in Java?What is a local inner class in Java? What are the rules around accessing variables from its enclosing method?Why is Java called a platform-independent language?G1 GC vs ZGC vs Shenandoah — when would you choose each?Heap keeps growing even after a Full GC runs. How do you debug it?What are anonymous inner classes in Java, and what are their restrictions compared to named classes?Why doesn't Java use pointers the way C/C++ does?What is method overloading vs method overriding?What is the difference between List and Set in Java?What is the difference between byte streams and character streams in Java I/O — when do you use InputStream/OutputStream vs Reader/Writer?Production throws OutOfMemoryError: Metaspace. What could cause it?What is the difference between abstract class and interface?Explain the 'static' keyword — static variable, method, block, class.What is the difference between HashSet, LinkedHashSet, and TreeSet?Java heap is stable, but overall process memory keeps growing. Why?What is the difference between FileReader and BufferedReader, and why does wrapping one in the other improve performance?What is the difference between CopyOnWriteArraySet and a regular HashSet?What is the difference between java.io and java.nio? What does NIO's non-blocking, buffer-based model actually change?What is the difference between pass-by-value and pass-by-reference in Java?Your application pauses frequently, but GC logs look completely normal. What's going on?What is autoboxing and unboxing?What is Escape Analysis? Why is it useful?What is the difference between Comparable and Comparator in Java?Why should file handling code always use try-with-resources instead of manually closing streams in a finally block?What is the Parent Delegation Model in class loading, and why is it important?What is the diamond problem and how does Java 8 solve it with default methods?How do Java enums work internally? What do values(), ordinal(), and valueOf() actually do?What is the difference between Collection and Collections in Java?Can a Java enum have constructors, fields, and methods? Can each enum constant override a method differently?Explain how 'instanceof' works and what pattern matching for instanceof (Java 16) does.What is the difference between the Collections Framework and the Streams API?How do you capture and analyze a heap dump using Eclipse MAT — what do you actually look for?What is String immutability? Why is String immutable in Java?What is TLAB (Thread Local Allocation Buffer) and how does it improve allocation performance?Why are enums a good fit for switch statements and as HashMap/EnumMap keys?What are the access modifiers in Java, and what does each one control?What is the difference between this and super keywords in Java?What is the String constant pool?What is GC ergonomics and how does the JVM auto-tune GC settings?Why do Virtual Threads become pinned and lose scalability?Can a constructor be declared final or static in Java?What is the difference between String, StringBuilder, and StringBuffer?Can you override a private or static method in Java?Find the longest palindromic substring.What is structured concurrency in Java 21+ and why is it better than raw CompletableFuture chains?Minimum window substring — find the smallest window in S containing all characters of T.What is a marker interface in Java? Give an example.Why are exceptions inside CompletableFuture chains often missed silently?Can you catch multiple exception types in a single catch block?What is the difference between Array and ArrayList?ConcurrentHashMap is thread-safe, yet race conditions can still exist in code that uses it. Why?Find the maximum subarray sum (Kadane's algorithm).Can you throw a checked exception inside a lambda expression's body?Why can increasing the thread pool size actually reduce application performance?Sort an array of 0s, 1s, and 2s in a single pass (Dutch National Flag).What is the difference between synchronized, ReentrantLock, and StampedLock?What are the different ways to create a thread in Java?Can you start the same Thread object twice in Java?What is the difference between CountDownLatch, CyclicBarrier, and Semaphore?Trapping rainwater problem — compute how much water can be trapped.What are the different states in a Java thread's lifecycle?Find the longest increasing subsequence (LIS).How does ForkJoinPool differ from a regular ThreadPoolExecutor?What happens when you submit too many tasks to a ThreadPoolExecutor — what are the rejection policies?What is the difference between Runnable and Callable interfaces in Java?Explain the Collections hierarchy — List, Set, Map, Queue.What are Method References in Java, and what are the 4 types?What is a race condition and how is it different from a data race?How does HashMap work internally? (hashing, buckets, collision)A ThreadLocal variable in your app is causing a memory leak. How does that happen, and how do you fix it?How does Collectors.groupingBy() work in the Stream API? Give an example.What is the difference between HashMap and Hashtable?What is the Function functional interface in Java, and when do you use it?How does ConcurrentHashMap differ from HashMap?A HashMap has millions of entries and suddenly becomes slow. How would you investigate?What is the Predicate functional interface in Java, and when do you use it?You insert a mutable object as a HashMap key and later modify it. What can go wrong?What is fail-fast vs fail-safe iterator?What is the Supplier functional interface in Java, and when do you use it?Your CopyOnWriteArrayList is creating high memory usage and GC pressure. Why?Implement an LRU cache using LinkedHashMap.What is the Consumer functional interface in Java, and when do you use it?A ConcurrentModificationException occurs in a single-threaded application. How is that possible?What happens when HashMap capacity exceeds load factor? Explain rehashing.What are the key features introduced in Java 8?You're reviewing production code using Collections.synchronizedMap(). Would you keep it or replace it? What factors decide?What are the BiFunction, BiPredicate, and BiConsumer functional interfaces?Why can a poor hashCode() implementation destroy HashMap performance?What is a functional interface? Can you write a custom one?What are UnaryOperator and BinaryOperator, and how do they differ from Function and BiFunction?What are primitive functional interfaces in Java, and why do they exist?Two threads call computeIfAbsent() for the same key on a ConcurrentHashMap at the same time. What behavior do you expect?What is the difference between map() and flatMap() in Streams?What is EnumMap and why is it more performant than HashMap for enum keys?What is the Optional class? How does it prevent NullPointerException?What does the Stream filter() method do, and how is it different from map()?What is the difference between lazy and eager evaluation in Streams? Explain with an example.You need the top 10 most frequent items out of millions of events. Which collections would you combine to solve this efficiently?What does the Stream collect() method do, and what's the difference between collect() and forEach()?A cache should automatically release entries when their keys are no longer strongly referenced elsewhere. What would you use?What is the difference between checked and unchecked exceptions?What does the Stream distinct() method do, and how does it determine uniqueness?Are Java Records truly immutable? What are their limitations?What do the Stream limit() and skip() methods do?What is try-with-resources? How does it differ from traditional try-catch-finally?What does the Stream count() method do, and how does it interact with filter()?What are Sealed Classes in Java 17 — how do they enforce domain modeling?How do you create a custom exception? Give checked and unchecked examples.What is the difference between anyMatch(), allMatch(), and noneMatch() in the Stream API?What is exception chaining?What is Pattern Matching for switch (Java 21) and how does it improve type-safe branching?What is the difference between ClassNotFoundException and NoClassDefFoundError?What are Sequenced Collections in Java 21?How does Java 21's virtual thread implementation handle blocking I/O internally — what is carrier thread pinning?What is the difference between a Thread and a Process?What is the difference between var (Java 10) and explicitly typed declarations — when does var hurt readability?What is the difference between wait(), notify(), and notifyAll()?What is a deadlock? How can you detect and prevent it?Java 25 Compact Object Headers (JEP 519) — what does it mean for production workloads?What is the volatile keyword in Java?What is the Sliding Window pattern in DSA, and what class of problems does it solve efficiently?What is ExecutorService? How is it better than creating raw threads?What is the two-pointer pattern? Give an example problem where it turns an O(n²) solution into O(n).What is the fast & slow pointers pattern? How does it detect a cycle in a linked list?What is a thread-safe Singleton? Implement double-checked locking.What is the merge intervals pattern? Walk through merging a list of overlapping intervals.What is the Java Memory Model (JMM)? Explain happens-before.What is the Top K Elements pattern using a heap, and why is it more efficient than sorting the entire dataset?What is CompletableFuture? How does it differ from Future?What is the 0/1 Knapsack dynamic programming pattern, and what other problems share its structure?Reverse a Singly Linked ListWhat is the topological sort graph pattern? How does it apply to a course-scheduling / build-order problem?Detect a loop in a Linked ListFind the Kth largest element in a stream of numbers, where new numbers keep arriving.LRU Cache implementationImplement an LFU (Least Frequently Used) Cache with O(1) get and put.Binary Tree TraversalsFind the median from a data stream — numbers keep arriving one at a time, and you must return the median at any point.Validate a Binary Search Tree (BST)Dijkstra's Shortest Path AlgorithmSolve the Word Ladder problem — find the shortest transformation sequence from one word to another, changing one letter at a time.Topological SortWhat are the different memory areas in JVM?What is Garbage Collection and how does it work?What is ClassLoader? Explain the delegation model.What is the difference between WeakReference, SoftReference, and PhantomReference?How does the JIT compiler work?Singleton PatternBuilder Pattern vs Telescoping ConstructorSOLID Principles overviewWhat is Code Cache and what happens when it fills up?What does the -XX:+PrintCompilation flag show you?What are the performance trade-offs between a 32-bit and 64-bit JVM?What is an escaping reference, and what are the ways to prevent your internal mutable state from leaking to callers?How do you tune the String Pool for an application creating millions of unique strings?What is String Deduplication in G1 GC and how is it different from the String Pool?Why should -Xms and -Xmx be set to the same value in production?What are the most important JVM flags you should know for production tuning?Why should you never call System.gc() in production code?Why is Object.finalize() dangerous, and what should you use instead?What is Java Flight Recorder and how is it different from a heap dump?Why is naive Java benchmarking (System.nanoTime() around a loop) misleading?What is JMH and what does it handle that a hand-rolled benchmark doesn't?What is a DirectByteBuffer, and why can it cause OutOfMemoryError even when heap usage looks fine?Your Java process consumes 100% CPU — walk through diagnosing exactly which thread and method is responsible.What does jcmd VM.native_memory reveal that a heap dump cannot?Your Spring Boot app gets OOM-killed in Kubernetes even though heap usage looks fine — how do you size JVM memory correctly for a container?What are the different types of OutOfMemoryError, and what does each one actually mean?What tools would you reach for to monitor a Java application's performance in production?What is GraalVM and how does its Native Image differ from a standard JVM?Does the final keyword make an object immutable?When should you choose ArrayList over LinkedList (and vice versa)?What are the two mandatory rules for overriding hashCode(), and what breaks if you only override equals()?When would you use TreeMap or LinkedHashMap over a plain HashMap?Why can naive string concatenation in a loop hurt performance, and did Java 9 change this?When can a Stream pipeline actually be slower than a plain for-loop?Why should you never use double for financial calculations?Why does volatile guarantee visibility but not atomicity?How does ConcurrentHashMap achieve thread safety without locking the entire map?When would you choose LongAdder over AtomicInteger?How do you size a ThreadPoolExecutor differently for CPU-bound vs I/O-bound workloads?What's the difference between thenApply(), thenCompose(), and thenCombine() in CompletableFuture?You receive a production thread dump with hundreds of BLOCKED threads — how do you identify the root cause?
Open Core Java
2
3
4
5
6