Java Interview Roadmap for Beginners: A 30-Day Plan
Codevity Admin · 10/25/2026
Codevity Admin · 10/25/2026
Java interviews for freshers (0 to 1 year of experience) follow a predictable pattern. There is a round of fundamentals (the JVM, strings, == versus equals()), object-oriented questions (overriding, abstract class versus interface), collections with HashMap internals, exceptions, a block on Java 8+ features and streams, a few questions on threads and memory, and usually one or two coding problems such as reversing a string or "two sum". Many interviews for service companies also touch JDBC and Spring Boot basics.
This roadmap turns that pattern into a 30-day plan and shows where each topic lives in this collection.
The examples are written for Java 21, a long-term-support (LTS) release, and they run on later versions. The LTS releases are 8, 11, 17, 21 and 25, and many companies are still on 8, 11 or 17, so interviewers may ask which features arrived when. The text points out the version where it matters (for example records in Java 16, sealed classes in Java 17 and virtual threads in Java 21).
Almost every example is a complete program that you can paste into one file and run with java File.java. The only exceptions are the JDBC, Spring Boot and JUnit examples, which need libraries and are marked "Illustrative" in their first line.
Install a JDK (Eclipse Temurin or Oracle OpenJDK 21 or newer), then check it:
java -version
javac -versionCreate Hello.java and run it, either in two steps or in one:
javac Hello.java # compile
java Hello # run
java Hello.java # or: compile and run a single file in one step (Java 11 and later)Use IntelliJ IDEA Community or Visual Studio Code with the Java extensions. For every topic, type the example yourself, run it, then change it and predict the result before you run it again.
| Days | Focus | Study this | Goal |
|---|---|---|---|
| 1 to 5 | Foundations: JVM, types, flow | JDK vs JRE vs JVM, data types and pass-by-value | Explain how Java runs and why it is pass-by-value |
| 6 to 11 | Strings and core OOP | Strings, OOP, equals and hashCode, Fundamentals, Strings and OOP quiz | Master the string pool, overriding versus hiding and the hashing contract |
| 12 to 16 | Collections and generics | Collections and HashMap, Generics, Collections, Generics and Exceptions quiz | Explain HashMap internals and write type-safe code |
| 17 to 21 | Exceptions and Java 8+ | Exceptions, Modern Java, Streams | Write fluent stream pipelines and handle errors robustly |
| 22 to 26 | Concurrency and the JVM | Threads, Executors and virtual threads, JVM memory and GC, Modern Java, Streams and Concurrency quiz | Explain race conditions, deadlocks and garbage collection |
| 27 to 30 | Enterprise basics and mock interviews | JDBC, SOLID, DI and Spring Boot, Unit testing, 25 mistakes, 35 coding problems, Top 50 questions, JVM, JDBC, Spring and Coding quiz | Answer under time pressure and explain your reasoning aloud |
| Minutes | Activity | How |
|---|---|---|
| 15 | Say it aloud | Explain the day's main question in under 60 seconds without filler words, then contrast it with a neighbouring concept ("How does an interface differ from an abstract class?") |
| 35 | Study | Read the explanation, the memory implications and the edge cases. Trace how objects live on the stack and heap instead of memorizing definitions |
| 30 | Type code | Write the examples yourself in a new file. Test , empty collections and boundary values |
| 10 | Mistake journal | Write down every compiler error, exception and wrong assumption from today |
Re-read your mistake journal on days 12, 22 and 29. It is the cheapest and most personal revision material you will ever have.
Start with JDK vs JRE vs JVM: how Java code runs. Every step in this collection also has its own page, so you can jump straight to the topic you need.
nullStringBuilderStringBuffernull