Java Developer Roadmap
Complete — Nothing Skipped
■ PHASE 1: Programming Basics
1. Introduction to Java
• What is Java? Write Once Run Anywhere (WORA) philosophy
• History of Java — James Gosling, Sun Microsystems, 1995
• Features: platform independent, OOP, robust, secure, multithreaded
• JDK vs JRE vs JVM — know the difference cold
• Bytecode — what it is, why it enables portability
• Compilation process: .java → javac → .class → JVM execution
■ JVM is the engine. JRE = JVM + libraries. JDK = JRE + dev tools (compiler, debugger).
2. Variables & Data Types
• Primitive types: byte, short, int, long, float, double, char, boolean
• Default values of primitives (int = 0, boolean = false, etc.)
• Non-primitive: String, Arrays, Objects
• Type casting — implicit (widening) vs explicit (narrowing)
• Wrapper classes: Integer, Double, Character, Boolean, etc.
• Autoboxing and unboxing
■ Widening = safe (int to long). Narrowing = risky (double to int), needs explicit cast.
3. Operators
• Arithmetic: +, -, *, /, %
• Relational: ==, !=, <, >, <=, >=
• Logical: &&, ||, !
• Bitwise: &, |, ^, ~, <<, >>, >>>
• Assignment: =, +=, -=, etc.
• Unary: ++, --, +, -
• Ternary: condition ? val1 : val2
• Operator precedence — memorize the order
4. Control Statements
• if / else if / else
• switch statement (classic + switch expression in Java 14+)
• for loop, while loop, do-while loop
• Enhanced for loop (for-each)
• break, continue, labeled break
5. Arrays
• 1D Array — declaration, initialization, traversal
• 2D Array — matrix operations
• Jagged Array — arrays of different lengths
• Arrays class utility methods: sort, fill, copyOf, binarySearch
• Array vs ArrayList — when to use which
■ PHASE 2: OOP Mastery
6. Core OOP Concepts
Class & Object
• Class as a blueprint, object as an instance
• Memory — stack vs heap
• Reference variables
Constructors
• Default constructor
• Parameterized constructor
• Constructor overloading
• Constructor chaining (this())
this Keyword
• Referring to current instance
• Distinguishing instance variables from parameters
• Calling another constructor in the same class
Encapsulation
• Private fields + public getters/setters
• Why it matters: data hiding, control over access
Abstraction
• Abstract classes
• Interfaces
• Abstract class vs Interface — key differences
Inheritance
• Single inheritance in Java
• extends keyword
• Method inheritance and override
• Multilevel inheritance
• Why Java doesn't support multiple class inheritance
Polymorphism
• Compile-time (method overloading)
• Runtime (method overriding)
• Dynamic method dispatch
• Upcasting and downcasting
7. Advanced OOP
• static keyword — fields, methods, blocks, nested classes
• final keyword — variables (constant), methods (no override), classes (no extend)
• super keyword — access parent class members and constructor
• instanceof operator — type checking before casting
• Object class — root of all Java classes
• toString() — string representation of object
• equals() — logical equality (vs == which checks reference)
• hashCode() — contract with equals(), used in hash-based collections
■ If you override equals(), you MUST override hashCode(). HashMap depends on this contract.
■ PHASE 3: Advanced Java
8. Strings
• String immutability — why Strings can't be changed
• String pool — intern(), memory optimization
• String vs StringBuilder vs StringBuffer
• When to use StringBuilder (single thread) vs StringBuffer (multi-thread)
• Common String methods: length, charAt, substring, indexOf, split, replace, trim, toUpperCase, toLowerCase,
contains, startsWith, endsWith
• [Link]() and [Link]()
• String comparison: equals() vs == vs compareTo()
■ String concatenation in a loop? Use StringBuilder. String + String creates new objects every time.
9. Exception Handling
• What is an exception? Error vs Exception
• Exception hierarchy: Throwable → Error / Exception → RuntimeException
• try, catch, finally blocks
• Multiple catch blocks — order matters (specific before general)
• throw — manually throw an exception
• throws — declare checked exceptions in method signature
• Checked exceptions (must handle: IOException, SQLException)
• Unchecked exceptions (RuntimeException: NullPointerException, ArrayIndexOutOfBoundsException)
• Custom exceptions — extending Exception or RuntimeException
• try-with-resources (Java 7+) — AutoCloseable resources
• Exception chaining — wrapping one exception in another
10. Collections Framework
■ One of the most important topics for interviews. Know it deep.
Collection Hierarchy
• Iterable → Collection → List / Set / Queue
• Map (separate hierarchy — does not extend Collection)
List Interface
• ArrayList — dynamic array, O(1) get, O(n) insert/delete
• LinkedList — doubly linked list, O(1) insert/delete at ends, O(n) get
• Vector — legacy, synchronized ArrayList (avoid in new code)
• Stack — LIFO, extends Vector (use Deque instead in modern code)
• ArrayList vs LinkedList — when to use which
Set Interface
• HashSet — no order, O(1) add/remove/contains, backed by HashMap
• LinkedHashSet — insertion order maintained, slightly slower than HashSet
• TreeSet — sorted order (natural or Comparator), O(log n) operations, backed by TreeMap
• EnumSet — high-performance Set for enum types
Queue & Deque Interface
• Queue — FIFO: offer(), poll(), peek()
• PriorityQueue — elements ordered by natural order or Comparator (min-heap by default)
• ArrayDeque — double-ended queue, faster than LinkedList for stack/queue use
• Deque as Stack — push(), pop(), peek()
Map Interface
• HashMap — key-value pairs, O(1) average, no order, allows one null key
• LinkedHashMap — insertion order maintained
• TreeMap — sorted by key (natural or Comparator), O(log n)
• Hashtable — legacy, synchronized (avoid)
• EnumMap — for enum keys, highly efficient
• WeakHashMap — keys held by weak references (GC can collect them)
• IdentityHashMap — uses == instead of equals() for key comparison
HashMap Internals (Interview Essential)
• Internal array of buckets (Node<K,V>[] table)
• Hash function: [Link]() → index
• Collision handling: chaining (LinkedList per bucket before Java 8, TreeNode after)
• Load factor (default 0.75) and resizing (capacity doubles)
• Java 8: bucket converts to Red-Black Tree when chain length >= 8
• Initial capacity (default 16) and why it's always a power of 2
■ If two keys have the same hashCode() but different equals(), they go in the same bucket as a chain. This is a collision.
Concurrent Collections
• ConcurrentHashMap — thread-safe HashMap, segment locking
• CopyOnWriteArrayList — thread-safe list, creates copy on write
• CopyOnWriteArraySet — backed by CopyOnWriteArrayList
• BlockingQueue: LinkedBlockingQueue, ArrayBlockingQueue — used in producer-consumer
Comparable vs Comparator
• Comparable — natural ordering, implement in the class itself (compareTo())
• Comparator — external ordering, pass as argument (compare())
• [Link]() chaining (Java 8+)
• Use case: sort by multiple fields
Collections Utility Class
• [Link](), [Link](), [Link]()
• [Link](), [Link]()
• [Link]/Set/Map()
• [Link]/Set/Map()
• [Link](), [Link]()
Generics
• Type safety at compile time
• Generic classes and methods
• Bounded type parameters: <T extends Number>
• Wildcards: <?>, <? extends T>, <? super T>
• Type erasure — generics are compile-time only
Iterator & ListIterator
• Iterator — hasNext(), next(), remove()
• ListIterator — bidirectional, add() and set() support
• ConcurrentModificationException — modifying collection while iterating
• Fail-fast vs fail-safe iterators
11. Multithreading
• Thread lifecycle: NEW, RUNNABLE, BLOCKED, WAITING, TIMED_WAITING, TERMINATED
• Creating threads: extend Thread vs implement Runnable
• Callable and Future — return values from threads
• Thread methods: start(), run(), sleep(), join(), interrupt(), yield()
• Synchronization — synchronized block and method
• Deadlock — what it is, how to avoid
• Inter-thread communication: wait(), notify(), notifyAll()
• volatile keyword — visibility guarantee
• ThreadLocal
• ExecutorService and thread pools
• CountDownLatch, Semaphore, CyclicBarrier
12. File Handling & I/O
• File class — create, delete, check existence
• FileReader, FileWriter — character streams
• FileInputStream, FileOutputStream — byte streams
• BufferedReader, BufferedWriter — efficient I/O
• Scanner for file input
• try-with-resources for automatic closing
• Serialization — ObjectOutputStream, ObjectInputStream
• Serializable interface and serialVersionUID
• transient keyword — skip field during serialization
• NIO basics — Path, Files utility class (Java 7+)
13. Java 8+ Features
• Lambda expressions — anonymous function syntax
• Functional interfaces: Runnable, Comparator, Function, Predicate, Consumer, Supplier, BiFunction
• @FunctionalInterface annotation
• Method references: ClassName::method
• Stream API — pipeline of operations on collections
• Stream operations: filter, map, flatMap, collect, reduce, forEach, sorted, distinct, limit, skip
• Collectors: toList, toSet, toMap, groupingBy, joining
• Optional — handle null safely
• Default and static methods in interfaces
• Date & Time API: LocalDate, LocalTime, LocalDateTime, ZonedDateTime, Duration, Period
• CompletableFuture — async programming
• var keyword (Java 10) — local variable type inference
• Records (Java 16) — immutable data classes
• Sealed classes (Java 17)
• Text blocks (Java 15) — multi-line strings
• Pattern matching instanceof (Java 16)
■ PHASE 4: Database + Backend
14. SQL
• DDL: CREATE, ALTER, DROP, TRUNCATE
• DML: INSERT, UPDATE, DELETE, SELECT
• Filtering: WHERE, LIKE, IN, BETWEEN, IS NULL
• Joins: INNER, LEFT, RIGHT, FULL OUTER, CROSS, SELF
• Aggregate functions: COUNT, SUM, AVG, MIN, MAX
• GROUP BY, HAVING
• ORDER BY, LIMIT, OFFSET
• Subqueries and nested queries
• Normalization: 1NF, 2NF, 3NF
• Indexing — what it is, types, when to use
• Transactions: COMMIT, ROLLBACK, SAVEPOINT
• ACID properties
15. JDBC
• JDBC Architecture — DriverManager, Connection, Statement, ResultSet
• 4 types of JDBC drivers
• Loading the driver, establishing connection
• Statement vs PreparedStatement vs CallableStatement
• CRUD operations with PreparedStatement
• ResultSet navigation methods
• Connection pooling concept — why it matters
• Handling SQL exceptions
16. Servlets & JSP
• Servlet lifecycle: init(), service(), destroy()
• HttpServlet — doGet(), doPost()
• HttpServletRequest and HttpServletResponse
• Session management: HttpSession, Cookies, URL rewriting
• Servlet context and config
• JSP basics — scriptlets, expressions, directives
• MVC pattern with Servlets and JSP
■ Servlets/JSP are legacy but interviewers still ask lifecycle and session management.
17. Spring Framework
Spring Core
• IoC (Inversion of Control) — what and why
• Dependency Injection — constructor injection vs setter injection
• ApplicationContext vs BeanFactory
• Bean lifecycle, scopes (singleton, prototype, request, session)
• Annotations: @Component, @Service, @Repository, @Controller, @Autowired, @Qualifier
Spring Boot
• Auto-configuration and starter dependencies
• @SpringBootApplication — what it does under the hood
• [Link] / [Link]
• Embedded Tomcat
• Spring Boot DevTools
REST API with Spring Boot
• @RestController, @RequestMapping, @GetMapping, @PostMapping, @PutMapping, @DeleteMapping
• @PathVariable, @RequestParam, @RequestBody, @ResponseBody
• ResponseEntity — control HTTP status codes
• Exception handling with @ControllerAdvice and @ExceptionHandler
Spring Data JPA
• ORM concept — mapping objects to DB tables
• @Entity, @Table, @Id, @GeneratedValue, @Column
• JpaRepository — built-in CRUD methods
• Custom queries: JPQL and @Query
• Relationships: @OneToOne, @OneToMany, @ManyToOne, @ManyToMany
• Pagination and sorting: Pageable
• Lazy vs Eager loading
Spring Security (Basics)
• Authentication vs Authorization
• HTTP Basic, Form-based login
• JWT authentication flow
• @PreAuthorize, @Secured
■ PHASE 5: Pro Level
18. Design Patterns
• Creational: Singleton, Factory, Abstract Factory, Builder, Prototype
• Structural: Adapter, Decorator, Facade, Proxy
• Behavioral: Strategy, Observer, Command, Template Method, Iterator
• DAO Pattern — separate data access logic
• MVC Pattern — Model, View, Controller
■ Singleton and Factory are the most common in Java interviews. Know thread-safe Singleton.
19. Microservices
• Monolith vs Microservices architecture
• REST APIs — HTTP methods, status codes, idempotency
• JSON — structure, serialization/deserialization with Jackson
• Postman — API testing
• Swagger / OpenAPI — API documentation
• Service discovery (Eureka), API Gateway
• Circuit breaker pattern (Resilience4j)
• Docker basics — containers, images, Dockerfile, docker-compose
• Kafka basics — messaging, topics, producers, consumers
20. Tools & Build
• Git — init, add, commit, push, pull, branch, merge, rebase, stash
• GitHub — PRs, code review, GitHub Actions basics
• Maven — [Link], dependency management, build lifecycle
• Gradle — [Link], tasks
• IntelliJ IDEA — shortcuts, debugger, profiler
• JUnit 5 — @Test, @BeforeEach, @AfterEach, assertions
• Mockito — mocking dependencies in unit tests
• Logging with SLF4J + Log4j or Logback
■ PHASE 6: DSA (Critical for Interviews)
Complexity
• Big O notation — time and space complexity
• Best, average, worst case
• Amortized analysis
Fundamentals
• Recursion — base case, recursive case, call stack
• Tail recursion
• Memoization vs Tabulation (DP intro)
Sorting Algorithms
• Bubble, Selection, Insertion — O(n2)
• Merge Sort — O(n log n), stable, divide and conquer
• Quick Sort — O(n log n) avg, O(n2) worst, in-place
• Heap Sort
• Counting Sort, Radix Sort — non-comparison based
Searching
• Linear search — O(n)
• Binary search — O(log n), sorted array only
• Binary search on answer pattern
Data Structures
• Stack — LIFO, push/pop/peek, applications (balanced parentheses, expression evaluation)
• Queue — FIFO, enqueue/dequeue, circular queue
• Singly Linked List — traversal, insert, delete, reverse
• Doubly Linked List
• Binary Tree — BFS, DFS (preorder, inorder, postorder)
• Binary Search Tree — insert, search, delete
• Heap — min-heap, max-heap, heapify, PriorityQueue in Java
• Graph — adjacency list vs matrix, BFS, DFS, topological sort, shortest path
• Trie — prefix tree for string problems
• Segment Tree (optional, for competitive coding)
Problem Patterns
• Two pointers
• Sliding window
• Fast and slow pointers
• Merge intervals
• Top K elements (PriorityQueue)
• Binary search variations
• Backtracking
• Dynamic Programming — 0/1 knapsack, LCS, LIS, coin change, DP on trees
■ FINAL: Job Ready Checklist
Projects to Build
• Student Management System (basic CRUD with JDBC or JPA)
• REST API with Spring Boot + JWT auth
• E-commerce backend (products, cart, orders, users)
• Banking System (accounts, transactions, balance)
• Blog API with full CRUD
■ Each project should be on GitHub with a proper README explaining the architecture.
Interview Prep
• Core Java — OOP, Collections internals, String, Exception handling
• Java 8 — Streams, Lambda, Optional
• Spring Boot — REST, JPA, Security
• DSA — at least 150+ Leetcode problems across patterns
• System design basics — scalability, caching, load balancing, DB sharding
• SQL — write queries on the spot
• Resume — highlight projects, not just coursework
• GitHub — all projects uploaded, clean commits