Guide contents

Java Deep Dive

Modern Java (21 and 25), concurrency, the Java Memory Model, atomics and lock-free code, JVM internals, JIT, garbage collectors, performance tooling, and low-latency Java for big tech, fintech, and trading interviews.

71 lessons in 22 sections

Start with Types, Variables, and Expressions →

Language Core

Types, strings, classes and interfaces, object contracts, exceptions, enums and annotations, packages and modules, records, sealed types, pattern matching, and Optional.

  1. 1.Types, Variables, and Expressions
  2. 2.Strings and Text
  3. 3.Classes, Interfaces, and Inheritance
  4. 4.Exceptions
  5. 5.Object Contracts: equals, hashCode, and Comparison
  6. 6.Immutability, Defensive Copying, and Object Lifecycle
  7. 7.Records and Sealed Types
  8. 8.Pattern Matching
  9. 9.Packages, Modules, and Reflection
  10. 10.Enums and Annotations

Generics

Generic classes and methods, bounded types, wildcards, PECS, and type erasure.

  1. 11.Generic Types, Bounds, and Wildcards
  2. 12.Type Erasure

Lambdas and Optional

Lambdas, method references, functional interfaces, Optional, and API design.

  1. 13.Lambdas and Functional Interfaces
  2. 14.Optional, Null Handling, and API Design

Collections

Lists, deques, HashMap internals, sorted maps, heaps, sequenced collections, and primitive collections.

  1. 15.Lists, Deques, and Iteration
  2. 16.HashMap Internals
  3. 17.Sorted Maps, Sets, and Priority Queues
  4. 18.Primitive Collections and Memory Cost

Streams

Streams, collectors, gatherers, parallel streams, and their cost.

  1. 19.Streams and Collectors
  2. 20.Gatherers, Parallel Streams, and Stream Cost

Testing

JUnit 5, Mockito, Testcontainers, and testing concurrent code.

  1. 21.JUnit 5
  2. 22.Mockito
  3. 23.Testcontainers and Testing Concurrent Code

Concurrency

Threads, locks, synchronizers, executors, CompletableFuture, concurrent collections, and virtual threads.

  1. 24.Threads, synchronized, wait and notify
  2. 25.Locks and Synchronizers
  3. 26.Executors and CompletableFuture
  4. 27.Concurrent Collections
  5. 28.Virtual Threads in Depth

CPU and Memory Hardware

Caches, cache lines, locality, coherence, store buffers, false sharing, branch prediction, and NUMA.

  1. 29.CPU Caches and Locality
  2. 30.Cache Coherence, False Sharing, Branch Prediction, and NUMA

Java Memory Model

Visibility, reordering, happens-before, volatile, safe publication, and final fields.

  1. 31.Visibility, Atomicity, and Reordering
  2. 32.Happens-Before and volatile
  3. 33.Safe Publication and final Fields

Atomics and Lock-Free Code

CAS, VarHandle access modes, fences, ABA, lock-free queues, and the Disruptor pattern.

  1. 34.Atomic Classes and CAS
  2. 35.VarHandle, Access Modes, and Fences
  3. 36.Ring Buffers and Lock-Free Queues
  4. 37.The LMAX Disruptor Pattern

JVM Internals

Bytecode, class loading, object layout, allocation, runtime data areas, safepoints, warmup, and deoptimization.

  1. 38.Bytecode and Class Loading
  2. 39.Object Layout and Allocation
  3. 40.Stack, Heap, Metaspace, and Code Cache
  4. 41.Safepoints, Warmup, and Deoptimization

JIT Compilation

C1 and C2, inlining, intrinsics, escape analysis, scalar replacement, lock elimination, and reading generated assembly.

  1. 42.Tiered Compilation, Inlining, and Intrinsics
  2. 43.Escape Analysis, Loop Optimizations, and Generated Assembly

Garbage Collection

GC fundamentals, G1, ZGC, Shenandoah, Serial, Parallel, Epsilon, and tuning with GC logs.

  1. 44.GC Fundamentals
  2. 45.G1 in Depth
  3. 46.ZGC and Shenandoah
  4. 47.Serial, Parallel, Epsilon, and GC Tuning

Off-Heap Memory

Direct buffers, memory-mapped files, and the Foreign Function and Memory API.

  1. 48.ByteBuffer, Direct Buffers, and Memory-Mapped Files
  2. 49.The Foreign Function and Memory API

Linux for Java

Processes, threads, scheduling, CPU affinity, virtual memory, page faults, and perf.

  1. 50.Processes, Threads, and Scheduling
  2. 51.Virtual Memory, Page Faults, and perf

Performance Tooling

JMH, JFR, async-profiler, flame graphs, percentiles, and coordinated omission.

  1. 52.Benchmarking with JMH
  2. 53.JFR, async-profiler, and Flame Graphs
  3. 54.Measuring Latency: Percentiles and Coordinated Omission

Networking and I/O

Blocking I/O, NIO, sockets, TCP and UDP options, multicast, the HTTP client, and binary protocols.

  1. 55.Streams, Readers, and Files
  2. 56.NIO Channels and Selectors
  3. 57.TCP, UDP, Multicast, and the HTTP Client
  4. 58.Binary Protocols and Encoding

Low-Latency Java

Allocation-free code, object reuse, busy spinning, thread affinity, and the Agrona, Aeron, SBE, and Chronicle libraries.

  1. 59.Allocation-Free and Cache-Friendly Code
  2. 60.Agrona, Aeron, SBE, and Chronicle

Fintech Correctness

Money and BigDecimal, rounding, idempotency, ledgers, and reconciliation in Java.

  1. 61.Money, BigDecimal, and Rounding
  2. 62.Idempotency, Ledgers, and Reconciliation

Trading Systems

Market data, order books, matching engines, and FIX, built as Java projects.

  1. 63.Market Data, Orders, and FIX
  2. 64.Project: Limit Order Book
  3. 65.Project: Matching Engine
  4. 66.Project: Market Data Handler

Java 17 to 25 Reference

A release-by-release map of the features taught in this course.

  1. 67.What Changed from Java 17 to Java 25

Interview Questions

Interview questions for senior and lead engineers covering every section of the course.

  1. 68.Core Java, Generics, Collections, and Streams
  2. 69.Concurrency, Memory Model, and Lock-Free Code
  3. 70.JVM, JIT, GC, and Performance
  4. 71.Low-Latency, Networking, Fintech, and Trading