Java Foundations — Theory-First Curriculum
Profile: Developer aiming at a Java Spring Boot backend job
Goal: Own the Java and OOP model that interviews and Spring both assume
Style: Mechanism first, small code proofs, interview traps, Spring connection
Recommended duration: 8–10 weeks for the full map; Weeks 1–9 are written
Daily time: 1.5–2.5 hours
Main rule: Do not build a huge project. Use tiny programs to prove the idea, then say the answer out loud.
0. Job target
This track is for backend interviews, not the Spring Professional exam.
Interviewers typically open with Java:
- Stack vs heap, references, pass-by-value
equals/hashCode, immutability,final- Encapsulation, constructors,
static - Overriding vs overloading, polymorphism
- Interface vs abstract class
- Composition vs inheritance, SOLID
- Exceptions, generics, collections, streams
- A practical concurrency and JVM picture
Spring questions come after that filter. The certificate still matters later. This curriculum is the on-ramp.
1. How to use this curriculum
For every topic, follow this format:
## Topic Name
### 1. What is it?
### 2. Why does it exist?
### 3. How does Java implement it?
### 4. Common interview traps
### 5. Tiny code proof
### 6. Spring connection
### 7. Interview answer (60–90 seconds)
Then practice the same idea with the four-part answer: problem, mechanism, trap, judgment.
2. Weekly structure
Each week has five study days plus review.
| Day | Activity |
|---|---|
| Monday | Read the lesson and write the memory sentences by hand |
| Tuesday | Compare two close ideas (primitive vs wrapper, class vs object) |
| Wednesday | Tiny code experiment in a throwaway class |
| Thursday | Answer the practice questions out loud, then check |
| Friday | Answer the linked interview questions out loud |
| Saturday | Review mistakes |
| Sunday | Rest or flashcards |
3. Full map
| Week | Status | Theme |
|---|---|---|
| 1 | Written | Types, memory, references, immutability, records |
| 2 | Written | OOP core: class, encapsulation, constructors, inheritance, Object |
| 3 | Written | OOP design: polymorphism, interfaces, composition, SOLID, Spring |
| 4 | Written | Exceptions, try-with-resources, domain translation, REST mapping |
| 5 | Written | Generics, erasure, wildcards, Optional |
| 6 | Written | Collections, HashMap, fail-fast, Comparable vs Comparator |
| 7 | Written | Streams, functional interfaces, collect, when a loop is clearer |
| 8 | Written | Threads, visibility, executors, @Async and @Transactional |
| 9 | Written | Modern Java for Spring Boot 3/4: records, sealed, switch, virtual threads |
OOP is Weeks 2–3. It is reused in every later week and in the Spring book.
4. Week 1 — Types and memory
Outcome: You can draw where a local int, a local reference, and a heap object live, and you can explain pass-by-value without saying “objects are passed by reference.”
| Day | Lesson |
|---|---|
| 1 | JVM, stack, and heap |
| 2 | Primitives, wrappers, and boxing |
| 3 | Pass-by-value, identity, and equality |
| 4 | final and immutability |
| 5 | Records as value objects |
| Review | Week 1 review |
Interview pages: Java fundamentals questions 1–4, 11, 14–16.
5. Week 2 — OOP core
Outcome: You can explain what a class is for, why fields are private, why constructors exist, and what overriding actually changes at runtime.
| Day | Lesson |
|---|---|
| 1 | Class versus object |
| 2 | Encapsulation and access |
| 3 | Constructors, this, and initialization |
| 4 | Inheritance, super, override vs overload |
| 5 | Object: toString, equals, hashCode |
| Review | Week 2 review |
Interview pages: Java fundamentals questions 2, 5, 14.
6. Week 3 — OOP design
Outcome: You can choose interface vs abstract class, prefer composition, name SOLID with a backend example, and explain why Spring DI and proxies are OOP mechanisms.
| Day | Lesson |
|---|---|
| 1 | Polymorphism and substitution |
| 2 | Interfaces vs abstract classes |
| 3 | Composition vs inheritance |
| 4 | SOLID in a small backend |
| 5 | How Spring uses OOP |
| Review | Week 3 review |
Interview pages: Java fundamentals questions 5, 6, 12; then Spring Core.
Next book chapter: What problem does Spring solve?
7. Week 4 — Exceptions
Outcome: You can draw the Throwable tree, close resources without hiding the original failure, throw named domain exceptions, and say the @Transactional rollback default.
| Day | Lesson |
|---|---|
| 1 | Throwable, checked, and unchecked |
| 2 | throw, throws, and catch |
| 3 | try-with-resources and finally |
| 4 | Domain exceptions and translation |
| 5 | Exceptions in REST and Spring |
| Review | Week 4 review |
Interview pages: Java fundamentals questions 7–8; then REST and MVC.
Spring book: Exception handling in Spring MVC
8. Week 5 — Generics
Outcome: You can explain erasure without saying “the JVM deletes all types,” use PECS on a copy signature, and keep Optional on return types only.
| Day | Lesson |
|---|---|
| 1 | Why generics and type parameters |
| 2 | Bounds and generic methods |
| 3 | Type erasure |
| 4 | Wildcards and PECS |
| 5 | Optional |
| Review | Week 5 review |
Interview pages: Java fundamentals questions 9–10.
Spring connection: JpaRepository<Order, Long>, ParameterizedTypeReference<List<Order>>, Optional<Order> findById.
9. Week 6 — Collections
Outcome: You can pick List/Set/Map by contract, draw HashMap.put, remove while iterating without CME, and explain why TreeSet uniqueness is compareTo.
| Day | Lesson |
|---|---|
| 1 | Collection, List, and ArrayList |
| 2 | Set and Map contracts |
| 3 | HashMap internals |
| 4 | Fail-fast iterators |
| 5 | Comparable vs Comparator |
| Review | Week 6 review |
Interview pages: Collections and streams questions 1–6, 11–12, 14; Java fundamentals questions 2 and 13.
10. Week 7 — Streams
Outcome: You can describe a lazy pipeline, flatten with flatMap, collect without side effects, and refuse parallel() inside a Spring transaction.
| Day | Lesson |
|---|---|
| 1 | Functional interfaces and lambdas |
| 2 | Stream pipelines and laziness |
| 3 | map, flatMap, and filter |
| 4 | collect, groupingBy, and reduce |
| 5 | When not to use streams |
| Review | Week 7 review |
Interview pages: Collections and streams questions 7–10.
11. Week 8 — Concurrency
Outcome: You keep singleton services stateless, pick lock vs volatile vs atomic, bound a thread pool, and explain why @Async does not see the caller’s persistence context.
| Day | Lesson |
|---|---|
| 1 | Threads and shared beans |
| 2 | synchronized, Lock, and volatile |
| 3 | Happens-before and safe publication |
| 4 | Executors and CompletableFuture |
| 5 | @Async, @Transactional, and ThreadLocal |
| Review | Week 8 review |
Interview pages: Concurrency and JVM questions 1–8, 11.
Spring book: Scheduling and async
12. Week 9 — Modern Java
Outcome: You can say 17 vs 21 in 60 seconds, use records and sealed types in an API, and explain virtual threads without ignoring Hikari.
| Day | Lesson |
|---|---|
| 1 | Java versions for Spring Boot |
| 2 | Records in APIs |
| 3 | Sealed types and pattern matching |
| 4 | Switch expressions and text blocks |
| 5 | Virtual threads |
| Review | Week 9 review |
Interview pages: Java fundamentals records; Concurrency and JVM virtual threads.
13. After this track
- Speak the Week 1–9 practice answers without notes.
- Open Java fundamentals, Collections and streams, and Concurrency and JVM and do the linked questions out loud.
- Start Spring book Week 1. Use Java Week 4 again when you reach MVC exception handling.
- Keep a tiny
OrderServiceexample in your head: interface, constructor injection, nonewof the repository,OrderNotFoundExceptionat the edge. That example is the bridge into Spring.