Crack Google, Amazon and every startup that asks DSA.
Stop grinding 500 random problems. Learn 13 patterns in order, and for every question see the brute force → better → best path, the exact time and space, and the Java you pick up along the way.
// Best: remember what you've seen static int[] twoSum(int[] nums, int target) { Map<Integer, Integer> seen = new HashMap<>(); for (int i = 0; i < nums.length; i++) { int need = target - nums[i]; if (seen.containsKey(need)) { return new int[]{seen.get(need), i}; } seen.put(nums[i], i); } return new int[]{}; }
How every question is taught
Three solutions. One idea each.
Interviewers want to see you reach the good answer, not recite it. So each note walks the same road you would walk in the room.
The obvious thing
Try everything. It is slow, but it is correct, and it is how you say "I understand the problem" out loud.
Spot the waste
Find what the brute force repeats, then remove it with sorting, a hash map or a prefix sum.
The interview answer
The optimal approach with code you can explain line by line, plus the time and space, plus why it works.
Java you learn
Small language facts that each question teaches: overflow, Integer ==, shallow clones.
Collection costs
The big-O of every API used, so HashMap vs TreeMap stops being a guess.
Other approaches
Kadane, sliding window, union-find, quickselect. Techniques from other topics, because those questions won't repeat.
Spaced revision
Tick a problem as done and it comes back on day 3 and day 10.
The roadmap
13 patterns, in the order that makes sense.
Work top to bottom, two problems a day. Each block starts with how to spot the pattern. Blocks marked Live have full notes. The rest are coming.
Why this works
Built for the way interviews are actually run.
Pattern first
You see a clue, you know the family of solutions. That beats memorising 500 answers.
Code that ran
Every solution in the notes was compiled and cross-checked on random inputs against the brute force.
Revision built in
Progress, notes and revision dates live in your browser. Back it up with one click.
Two problems a day. Eleven weeks.
Open the sheet, pick the first unticked problem, and read its note before you look at any solution.