Zum Hauptinhalt springen

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:

  1. Stack vs heap, references, pass-by-value
  2. equals / hashCode, immutability, final
  3. Encapsulation, constructors, static
  4. Overriding vs overloading, polymorphism
  5. Interface vs abstract class
  6. Composition vs inheritance, SOLID
  7. Exceptions, generics, collections, streams
  8. 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.

DayActivity
MondayRead the lesson and write the memory sentences by hand
TuesdayCompare two close ideas (primitive vs wrapper, class vs object)
WednesdayTiny code experiment in a throwaway class
ThursdayAnswer the practice questions out loud, then check
FridayAnswer the linked interview questions out loud
SaturdayReview mistakes
SundayRest or flashcards

3. Full map

WeekStatusTheme
1WrittenTypes, memory, references, immutability, records
2WrittenOOP core: class, encapsulation, constructors, inheritance, Object
3WrittenOOP design: polymorphism, interfaces, composition, SOLID, Spring
4WrittenExceptions, try-with-resources, domain translation, REST mapping
5WrittenGenerics, erasure, wildcards, Optional
6WrittenCollections, HashMap, fail-fast, Comparable vs Comparator
7WrittenStreams, functional interfaces, collect, when a loop is clearer
8WrittenThreads, visibility, executors, @Async and @Transactional
9WrittenModern 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.”

DayLesson
1JVM, stack, and heap
2Primitives, wrappers, and boxing
3Pass-by-value, identity, and equality
4final and immutability
5Records as value objects
ReviewWeek 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.

DayLesson
1Class versus object
2Encapsulation and access
3Constructors, this, and initialization
4Inheritance, super, override vs overload
5Object: toString, equals, hashCode
ReviewWeek 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.

DayLesson
1Polymorphism and substitution
2Interfaces vs abstract classes
3Composition vs inheritance
4SOLID in a small backend
5How Spring uses OOP
ReviewWeek 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.

DayLesson
1Throwable, checked, and unchecked
2throw, throws, and catch
3try-with-resources and finally
4Domain exceptions and translation
5Exceptions in REST and Spring
ReviewWeek 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.

DayLesson
1Why generics and type parameters
2Bounds and generic methods
3Type erasure
4Wildcards and PECS
5Optional
ReviewWeek 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.

DayLesson
1Collection, List, and ArrayList
2Set and Map contracts
3HashMap internals
4Fail-fast iterators
5Comparable vs Comparator
ReviewWeek 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.

DayLesson
1Functional interfaces and lambdas
2Stream pipelines and laziness
3map, flatMap, and filter
4collect, groupingBy, and reduce
5When not to use streams
ReviewWeek 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.

DayLesson
1Threads and shared beans
2synchronized, Lock, and volatile
3Happens-before and safe publication
4Executors and CompletableFuture
5@Async, @Transactional, and ThreadLocal
ReviewWeek 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.

DayLesson
1Java versions for Spring Boot
2Records in APIs
3Sealed types and pattern matching
4Switch expressions and text blocks
5Virtual threads
ReviewWeek 9 review

Interview pages: Java fundamentals records; Concurrency and JVM virtual threads.


13. After this track

  1. Speak the Week 1–9 practice answers without notes.
  2. Open Java fundamentals, Collections and streams, and Concurrency and JVM and do the linked questions out loud.
  3. Start Spring book Week 1. Use Java Week 4 again when you reach MVC exception handling.
  4. Keep a tiny OrderService example in your head: interface, constructor injection, no new of the repository, OrderNotFoundException at the edge. That example is the bridge into Spring.