teaching booklet — then jump to notebook Java

See the algorithm, then see a problem

Each topic page is built so you can learn the method, not memorize a template. Every algorithm has a simple Java version, an interview Java version, one tiny example, and one full step-by-step dry run. When the idea is solid, the tables at the bottom of each algorithm jump into this notebook’s question cards — chapter 05 for full Java, chapter 24 for the cheat, chapter 25 for the 30-second clue, Round 4 coding if that family showed up in a leftover hour.

how to read a card

Four blocks, same order, every algorithm

If a card still feels thin, it is unfinished — come back to the topic page, not to a random LeetCode editorial. Job 10454435 still has no public IE that names a live-round question. Unnamed stays unnamed.

1. Simple JavaFewer moving parts. Comments say why a line exists — especially when a node is marked visited, when a stack pops, when a window shrinks.
2. Interview JavaWhat you actually type in Live Code: empty input, disconnected graphs, Integer.compare, overflow-safe mid. Same idea, fewer training wheels.
3. Example 1 — simpleThree to five nodes, or a 4-character string. You should be able to finish the dry-run table without looking at the code.
4. Example 2 — every stepA second input that hits the awkward case (stale Dijkstra heap entry, DFS returning up a path, window that shrinks twice). No skipped rows.
Where the notebook fits This booklet is the “what is BFS / DFS / Kahn” layer. The Interview Notebook is the “this family showed up in someone else’s loop” layer. Click a row under Notebook problems only after you can dry-run Example 2. Chapter 05 is the full compilable Java. Chapter 24 is the 60-second speak. Chapter 25 is the clue → pattern scan. Round 4 chapter 6 is leftover-hour coding.
open a topic

Fifteen chapters, hardest cluster first

ChapterYou should leave able toThen open
01 GraphsBFS vs DFS on the same drawing; mark-on-enqueue; 3-state directed cycle; Kahn leftover = cycleRotten oranges, Course Schedule, Distance K, Open the Lock
02 Trees / Heaps / TriesInorder vs level order; path that bends; size-k min-heapDistance K, merge k lists, top-k, leaf path
03 BacktrackingChoose / explore / un-choose; copy the pathSubsets, partition / combination
04 DPSay the recurrence before coding; 0/1 vs unboundedHouse Robber II, Unique Paths, grid reward
05 GreedyName a counterexample or say why local max is globalRemove k digits, jump / stock family
06 Binary SearchSearch a range of answers, not only an arrayKoko / ship packages, aggressive cows
07 Sliding WindowFixed vs variable; atMost(k) − atMost(k−1)Anagrams, Nice Subarrays, window max
08 Two PointersOpposite-direction on sorted; fast/slow on a listCelebrity, rain water, switching lists
09 IntervalsSort by start; merge vs count overlapMerge intervals, min platforms
10 Prefix Sumrange = pref[r] − pref[l−1]; map of prefix frequenciesSubarray sum K, sum = 0
11 Linked ListsDummy head; reverse three pointersMerge k, reverse-k, max-sum switch
12 Stacks & QueuesMonotonic stack of indices; deque maxNext greater, daily temps, LRU, min stack
13 HashingOne pass “have I seen this”Group anagrams, loyal logs, two-sum shape
14 Arrays & StringsHonest Big-O; StringBuilder in a loopEncoded frequency, next permutation
15 Bits & MatricesXOR cancel; transpose then reverseRotate 90°, max 1s row, sudoku validate