// leetcode patterns
Algorithm Patterns,
One Session at a Time
16 tutoring sessions distilled into interview-ready notes — from the binary-search template that never off-by-ones to DP, graphs, and probability. Every classic Leetcode problem, solved in Java with the pattern spelled out.
01
Leetcode · S1
Binary Search & Binary Reduction
The left+1<right template, first/last occurrence, rotated arrays, and binary search on the answer space.
Jul 03, 2026
↗
02
Leetcode · S2
Sorting Algorithms
Selection, insertion, merge, quick and bucket sort — complexity, stability, and when interviewers expect each.
Jul 03, 2026
↗
03
Leetcode · S3
Linked List, Queue & Stack
Dummy heads, fast/slow pointers, reversal patterns and cycle detection — the linked-list toolkit.
Jul 03, 2026
↗
04
Leetcode · S4
Stack & Queue in Java
ArrayList vs LinkedList, Deque APIs, queue-from-stacks, min-stack, and the monotonic stack.
Jul 03, 2026
↗
05
Leetcode · S5
Binary Tree, BST & Divide and Conquer
Tree traversals, recursion vs divide-and-conquer, BST invariants, and the classic tree set.
Jul 03, 2026
↗
06
Leetcode · S6
Heap, HashMap & Graph
PriorityQueue mechanics, top-K patterns, HashMap internals, and graph representations.
Jul 03, 2026
↗
07
Leetcode · S7
Java OOP & Design Problems
Interfaces vs abstract classes, generics, the diamond problem, and designing Stack/Queue from scratch.
Jul 03, 2026
↗
08
Leetcode · S8
BFS, DFS & Dijkstra
Level-order BFS, backtracking DFS, and Dijkstra with a PQ — one traversal at a time.
Jul 03, 2026
↗
09
Leetcode · S9
Bit Manipulation & Math
XOR tricks, n & (n-1), overflow-safe arithmetic, and interview-favorite math problems.
Jul 03, 2026
↗
10
Leetcode · S10
Arrays & Strings
Two pointers, sliding window, prefix sums and in-place tricks — the highest-frequency category.
Jul 03, 2026
↗
11
Leetcode · S11
Dynamic Programming & Greedy
Recursion to memoization to bottom-up DP — states, transitions, and when greedy wins.
Jul 03, 2026
↗
12
Leetcode · S12
Recursion & Divide and Conquer
Recursion trees, master-theorem intuition, N-Queens, Sudoku, spiral matrix, and tree recursion.
Jul 03, 2026
↗
13
Leetcode · S13
Dynamic Programming II
Knapsack variants, interval DP, and 2D state design — where most candidates get filtered.
Jul 03, 2026
↗
15
Leetcode · S15
Arrays & Strings II
Harder array/string patterns — intervals, matrix traversal, and string manipulation.
Jul 03, 2026
↗
16
Leetcode · S16
Mixed Practice: Putting It All Together
Cross-topic problems that combine two or more patterns into one question.
Jul 03, 2026
↗
17
Leetcode · S17
Probability & Randomization
Reservoir sampling, shuffle, rejection sampling and rand7-from-rand10.
Jul 03, 2026
↗