A production-grade, interview-focused Data Structures & Algorithms repository in Python. Every topic has a
.md(theory + Q&A) and.py(clean implementations + test cases).
my-python-dsa/
├── fundamentals/ 🟢 Big-O, recursion, problem-solving strategies
├── data-structures/ 🟡 Arrays, LinkedLists, Trees, Graphs, Heaps, Tries
├── algorithms/ 🟠 Sorting, Searching, DP, Greedy, Graph algorithms
├── patterns/ 🔵 Sliding window, two pointers, backtracking, DP patterns
├── advanced/ 🔴 Segment trees, Fenwick, KMP, Bit manipulation
├── problems/ 🎯 Topic-wise problems (Easy → Hard)
│ ├── arrays/
│ ├── linked-lists/
│ ├── trees/
│ ├── graphs/
│ ├── dp/
│ └── strings/
├── mock-interviews/ 🏆 Timed sets, FAANG-style problems
├── 09_system-design/ 🏗️ System design through DSA lens
│ └── 01_system_design_for_dsa.md LRU cache, consistent hashing, Trie autocomplete, rate limiters, Snowflake ID
├── utils/ 🔧 Helpers, templates, debugging tools
└── README.md
- Big-O notation, time/space complexity
- Recursion: base cases, call stack, memoization intro
- Problem-solving framework (UMPIRE method)
- Arrays, strings, sliding window, prefix sum
- Linked lists: singly, doubly, cycle detection
- Stacks, queues, monotonic stack, deque
- Hash maps and sets
- Binary trees: DFS (pre/in/post), BFS
- Binary Search Trees: insert, delete, validate
- Heaps and priority queues
- Graph representations, BFS, DFS, topological sort
- Sorting: merge sort, quick sort, heap sort
- Binary search and its variations
- Greedy algorithms
- Dynamic programming: memoization → tabulation → optimization
- Sliding window, two pointers, fast & slow pointers
- Merge intervals, binary search on answer
- Backtracking patterns, DP patterns
- Segment trees, Fenwick trees
- Trie, LRU Cache
- Bit manipulation
- String algorithms: KMP, Rabin-Karp
- Advanced graphs: Dijkstra, Bellman-Ford, Union-Find
- Mock interviews (timed)
- FAANG-style problem sets
- System design basics
- How data structures power real systems
- LRU Cache → Redis eviction, browser history
- Consistent Hashing → distributed caches, load balancers
- Trie → autocomplete, spell checkers, IP routing
- Rate Limiters → token bucket, sliding window
- Snowflake ID → distributed unique ID generation
| Days | Focus |
|---|---|
| 1–3 | Big-O, recursion, arrays |
| 4–6 | Strings, hashing, two pointers |
| 7–9 | Linked lists, stacks, queues |
| 10–13 | Trees: DFS, BFS, BST |
| 14–16 | Heaps, graphs BFS/DFS |
| 17–19 | Sorting, binary search |
| 20–23 | Dynamic programming |
| 24–26 | Greedy, backtracking |
| 27–28 | Advanced topics |
| 29–30 | Mock interviews |
- Week 1–2: Fundamentals + Arrays/Strings
- Week 3–4: Linked Lists + Stacks/Queues + Hashing
- Week 5–6: Trees + Heaps
- Week 7–8: Graphs + Sorting/Searching
- Week 9–10: DP + Greedy + Backtracking
- Week 11: Advanced topics
- Week 12: Mock interviews + revision
- Month 1: Fundamentals + Data Structures
- Month 2: Algorithms + Patterns
- Month 3: Advanced + Mock Interviews + Competitive Programming
- Two Sum → Valid Parentheses → Best Time to Buy Stock
- Reverse Linked List → Merge Two Sorted Lists → LRU Cache
- Binary Tree Inorder → Max Depth → Validate BST
- Number of Islands → Clone Graph → Course Schedule
- Climbing Stairs → Coin Change → Longest Common Subsequence
- Merge Intervals → Meeting Rooms → Non-overlapping Intervals
- Word Search → N-Queens → Sudoku Solver
- Median of Two Sorted Arrays → Trapping Rain Water → Sliding Window Maximum
- UMPIRE: Understand → Match → Plan → Implement → Review → Evaluate
- Always clarify constraints before coding
- Start with brute force, then optimize
- Talk through your thought process out loud
- Analyze time/space complexity after every solution
- Test with: empty input, single element, duplicates, negatives
| Category | Score | Notes |
|---|---|---|
| DSA Coverage | 9.5/10 | All core topics + advanced |
| Algorithm Depth | 9/10 | Multiple approaches per problem |
| Interview Readiness | 9/10 | FAANG-style problems + mock interviews |
| Code Quality | 9.5/10 | Type hints, docstrings, test cases |
| Pattern Coverage | 9/10 | All major interview patterns |
| System Design (DSA-linked) | 9/10 | LRU, consistent hashing, Trie, rate limiters |
| Overall | 9.3/10 |
git clone https://github.com/tgrviswanath/my-python-dsa
cd my-python-dsa
python -m venv .venv
.venv\Scripts\activate # Windows
pip install -r requirements.txt
python fundamentals/01_big_o.py