A structured repository for learning data structures, algorithms, interview patterns, and high-signal LeetCode practice from first principles.
This repository is designed to help a beginner become interview-ready without memorizing solution dumps. The goal is to build durable intuition, pattern recognition, edge-case discipline, and precise complexity analysis.
The curation favors the pattern coverage of NeetCode 150, Blind 75, Grind 75, and classic high-frequency interview problems. It also adds targeted extras where a topic needs more practice than the major public lists provide.
Every topic should answer five questions for a learner and for an interviewer:
- What is the core intuition?
- What invariant makes the pattern correct?
- Which examples and edge cases expose the pattern?
- Which mistakes cause wrong answers in interviews?
- Which problems build the skill without duplicating practice entries elsewhere?
Each problem appears once in the repository. When a problem is relevant to more than one topic, it is assigned to the topic where the dominant interview pattern is most useful.
- Google interviewer: looks for invariants, proof sketches, and clean complexity analysis.
- Meta interviewer: looks for fast pattern recognition, concise code, and reliable edge-case execution.
- Amazon interviewer: looks for clarification, tradeoffs, operational thinking, and practical communication.
- OpenAI, Anthropic, and Mistral engineer: look for correctness under changed constraints, careful reasoning, and simple maintainable logic.
- Beginner learner: needs plain-language intuition, diagrams, deliberate practice order, and mistakes called out before they happen.
- Read the topic
README.mdbefore solving. - Read
PATTERNS.mdand write each invariant in your own words. - Use
CHEATSHEET.mdfor quick recall. - Solve Easy problems to learn mechanics.
- Solve Medium problems to build interview fluency.
- Use Hard problems selectively for advanced recognition and follow-up depth.
- Keep a separate mistake log with pattern, missed invariant, edge case, and retry date.
flowchart TD
arrays_hashing["Arrays & Hashing"]
two_pointers["Two Pointers"]
stack["Stack"]
binary_search["Binary Search"]
sliding_window["Sliding Window"]
linked_list["Linked List"]
trees["Trees"]
tries["Tries"]
heap_priority_queue["Heap / Priority Queue"]
backtracking["Backtracking"]
graphs["Graphs"]
advanced_graphs["Advanced Graphs"]
one_d_dp["1-D Dynamic Programming"]
two_d_dp["2-D Dynamic Programming"]
greedy["Greedy"]
intervals["Intervals"]
bit_manipulation["Bit Manipulation"]
math_geometry["Math & Geometry"]
arrays_hashing --> two_pointers
two_pointers --> stack
stack --> binary_search
binary_search --> sliding_window
sliding_window --> linked_list
linked_list --> trees
trees --> tries
tries --> heap_priority_queue
heap_priority_queue --> backtracking
backtracking --> graphs
graphs --> advanced_graphs
advanced_graphs --> one_d_dp
one_d_dp --> two_d_dp
two_d_dp --> greedy
greedy --> intervals
intervals --> bit_manipulation
bit_manipulation --> math_geometry
| Order | Topic | First Patterns | Folder |
|---|---|---|---|
| 1 | Arrays & Hashing | Frequency Counting, Hash Lookup, Prefix Sum | arrays-hashing/ |
| 2 | Two Pointers | Opposite Direction Pointers, Same Direction Pointers, Fast And Slow Pointers | two-pointers/ |
| 3 | Stack | LIFO Simulation, Balanced Delimiters, Monotonic Increasing Stack | stack/ |
| 4 | Binary Search | Classic Target Search, Lower Bound, Upper Bound | binary-search/ |
| 5 | Sliding Window | Fixed Window, Variable Window, Frequency Window | sliding-window/ |
| 6 | Linked List | Dummy Head, Two Pointer Gap, Fast And Slow Pointers | linked-list/ |
| 7 | Trees | Recursive DFS, Iterative DFS, BFS Level Order | trees/ |
| 8 | Tries | Prefix Insert And Search, Wildcard Trie DFS, Board Search Trie Pruning | tries/ |
| 9 | Heap / Priority Queue | Top K Heap, K-way Merge, Two Heaps | heap-priority-queue/ |
| 10 | Backtracking | Subsets, Combinations, Permutations | backtracking/ |
| 11 | Graphs | DFS Traversal, BFS Traversal, Connected Components | graphs/ |
| 12 | Advanced Graphs | Dijkstra, Bellman-Ford, Floyd-Warshall | advanced-graphs/ |
| 13 | 1-D Dynamic Programming | State Definition, Memoization, Tabulation | 1d-dp/ |
| 14 | 2-D Dynamic Programming | Grid DP, Two String DP, Knapsack Table | 2d-dp/ |
| 15 | Greedy | Sort And Scan, Greedy With Proof, Interval Greedy | greedy/ |
| 16 | Intervals | Merge Intervals, Insert Interval, Sweep Line | intervals/ |
| 17 | Bit Manipulation | XOR Cancellation, Bit Counting, Masks For Sets | bit-manipulation/ |
| 18 | Math & Geometry | Modulo Arithmetic, GCD And LCM, Prime Sieve | math-geometry/ |
Start with arrays, hashing, two pointers, stack, binary search, and sliding window. These topics teach the basic loop invariants used everywhere else. Then move to linked lists, trees, heaps, backtracking, graphs, and dynamic programming.
Beginner rule: do not start Medium practice in a topic until you can explain the Easy solutions without looking at notes.
When interviews are within 8 weeks, prioritize:
- Arrays & Hashing
- Two Pointers
- Sliding Window
- Stack
- Binary Search
- Trees
- Graphs
- Heap / Priority Queue
- 1-D Dynamic Programming
- Backtracking
Add Advanced Graphs, 2-D DP, Greedy, Intervals, Bit Manipulation, and Math after the core patterns are stable.
- Arrays & Hashing: README, patterns, cheatsheet, Easy, Medium, selected Hard
- Two Pointers: README, patterns, cheatsheet, Easy, Medium, selected Hard
- Stack: README, patterns, cheatsheet, Easy, Medium, selected Hard
- Binary Search: README, patterns, cheatsheet, Easy, Medium, selected Hard
- Sliding Window: README, patterns, cheatsheet, Easy, Medium, selected Hard
- Linked List: README, patterns, cheatsheet, Easy, Medium, selected Hard
- Trees: README, patterns, cheatsheet, Easy, Medium, selected Hard
- Tries: README, patterns, cheatsheet, Easy, Medium, selected Hard
- Heap / Priority Queue: README, patterns, cheatsheet, Easy, Medium, selected Hard
- Backtracking: README, patterns, cheatsheet, Easy, Medium, selected Hard
- Graphs: README, patterns, cheatsheet, Easy, Medium, selected Hard
- Advanced Graphs: README, patterns, cheatsheet, Easy, Medium, selected Hard
- 1-D Dynamic Programming: README, patterns, cheatsheet, Easy, Medium, selected Hard
- 2-D Dynamic Programming: README, patterns, cheatsheet, Easy, Medium, selected Hard
- Greedy: README, patterns, cheatsheet, Easy, Medium, selected Hard
- Intervals: README, patterns, cheatsheet, Easy, Medium, selected Hard
- Bit Manipulation: README, patterns, cheatsheet, Easy, Medium, selected Hard
- Math & Geometry: README, patterns, cheatsheet, Easy, Medium, selected Hard
- ROADMAP.md: learning order, prerequisites, and outcomes.
- STUDY_PLAN.md: 8-week, 12-week, and 24-week plans.
- INTERVIEW_GUIDE.md: interview communication and execution strategy.
- REPO_INDEX.md: generated index of topics, patterns, and problem counts.