β Star this repo if it helps you crack your interview!
103 solved problems across 15 topics, organized by the patterns and data
structures that appear most often in Python interviews. Each solution includes
an approach and complexity analysis; priority questions are marked _IMP.
Browse the filterable DSA Prep Atlas or follow the Core 120 roadmap for the planned learning sequence.
| Resource | Purpose |
|---|---|
| π Visual Index | Browse all problems in a filterable UI |
| PATTERNS.md | Signal β technique cheat-sheet β "which pattern do I use?" |
| DATA_STRUCTURES.md | Requirement β data-structure chooser |
| ROADMAP.md | Follow the curated path from 98 to 120 problems |
Core 120 progress: 103 / 120 problems (86%)
The original 98-problem collection is complete. The repository is now adding 22 carefully selected questions to strengthen thin and missing interview patterns.
| # | Topic | Easy | Medium | Hard | Total |
|---|---|---|---|---|---|
| 01 | Basic and Maths | 5 | 3 | 0 | 8 |
| 02 | Array and Prefix Sum | 8 | 9 | 0 | 17 |
| 03 | Strings | 4 | 4 | 1 | 9 |
| 04 | Hashing | 1 | 4 | 0 | 5 |
| 05 | Two Pointers & Sliding Window | 1 | 3 | 1 | 5 |
| 06 | Stack & Queue | 0 | 3 | 1 | 4 |
| 07 | Linked List | 3 | 2 | 0 | 5 |
| 08 | Trees | 5 | 2 | 2 | 9 |
| 09 | Binary Search | 1 | 2 | 2 | 5 |
| 10 | Greedy Problems | 1 | 5 | 0 | 6 |
| 11 | Dynamic Programming | 2 | 8 | 1 | 11 |
| 12 | Graphs | 2 | 5 | 0 | 7 |
| 13 | Heap & Priority Queue | 0 | 2 | 2 | 4 |
| 14 | Backtracking | 0 | 4 | 1 | 5 |
| 15 | Trie | 0 | 2 | 1 | 3 |
| Total | 33 | 58 | 12 | 103 |
Note: TreeNode.py in the Trees folder is a shared helper class, not a problem.
Counts and website mappings are verified automatically in CI: 103 solution files across 15 topic folders.
LCM & GCD Β· XOR properties Β· Power and modular exponentiation Β· Sieve of Eratosthenes Β· Perfect squares
Two Sum Β· 3Sum Β· Kadane's (max subarray) Β· Prefix sum Β· Product of array except self Β· Merge sorted arrays Β· Move zeroes
Valid parentheses Β· Longest substring without repeating Β· Minimum window substring Β· Longest palindromic substring Β· Group anagrams
Frequency counting Β· Longest consecutive sequence Β· Custom data structure design Β· Count distinct elements in window Β· Valid Sudoku
Two sum (sorted) Β· Sliding window maximum Β· Maximum consecutive ones Β· Character replacement Β· Permutation in string
Next greater element Β· Min stack Β· Largest rectangle in histogram Β· Rotten Oranges (multi-source BFS)
Reverse Β· Loop detection (Floyd's) Β· Merge sorted lists Β· Middle element Β· Remove nth from end
In/Pre/Post-order traversal Β· Level-order Β· Height Β· Diameter Β· LCA Β· Path sum Β· Max path sum Β· Subtree check Β· Serialize & Deserialize
Standard binary search Β· Search in rotated sorted array Β· Book allocation Β· Aggressive cows Β· Peak element
Monster battle Β· Minimum platforms Β· Job sequencing Β· Merge intervals Β· Gas station Β· Fractional knapsack
Fibonacci Β· Climbing stairs Β· Coin change Β· LIS Β· LCS Β· 0/1 Knapsack Β· Partition equal sum Β· Max product subarray Β· Edit distance Β· Unique paths Β· House robber
BFS template Β· DFS (recursive + iterative) Β· Number of Islands Β· Clone Graph Β· Course Schedule (topological sort) Β· Network Delay Time (Dijkstra) Β· Number of Provinces (Union-Find)
Kth largest element Β· Top K frequent elements Β· Merge K sorted lists Β· Find median from data stream
Subsets Β· Permutations Β· Combination sum Β· N-Queens Β· Word search
Implement Trie (prefix tree) Β· Add and search wildcard words Β· Word Search II
βββ 01. Basic and maths/ (8 problems)
βββ 02. Array and prefix_sum/ (17 problems)
βββ 03. Strings/ (9 problems)
βββ 04. Hashing/ (5 problems)
βββ 05. Two pointers & Sliding window/ (5 problems)
βββ 06. Stack & Queue/ (4 problems)
βββ 07. Linked List/ (5 problems)
βββ 08. Trees/ (9 problems + TreeNode.py helper)
βββ 09. Binary Search/ (5 problems)
βββ 10. Greedy Problems/ (6 problems)
βββ 11. Dynamic Programming/ (11 problems)
βββ 12. Graphs/ (7 problems)
βββ 13. Heap and Priority Queue/ (4 problems)
βββ 14. Backtracking/ (5 problems)
βββ 15. Trie/ (3 problems)
βββ tests/ β behavior and catalog consistency checks
βββ index.html β filterable visual index
βββ PATTERNS.md β signal β technique cheat-sheet
βββ DATA_STRUCTURES.md β requirement β data-structure chooser
βββ ROADMAP.md β path to the Core 120 collection
- Clone the repository
git clone https://github.com/Achal13jain/python-dsa-interview-prep.git cd python-dsa-interview-prep - Navigate to a topic folder and open any
.pyfile. - Read or run the solution β some files include a
if __name__ == "__main__":sample block, and the rest can be tested by calling the function/class directly. - Focus on
_IMPfiles for quick interview prep β these are the priority revision picks in this repo. - Read PATTERNS.md to recognise which technique to apply when you see a problem signal.
No third-party packages are required:
python -m unittest discover -s tests -vThe suite checks solution behavior, Python 3.9 syntax, duplicate or missing catalog entries, README counts, website mappings, and documentation redirects. GitHub Actions runs the same checks on Python 3.9 and 3.13 for every push and pull request.
_IMPβ Important priority picks for interview revision.- Regular files β Core problems for building solid fundamentals.
Basic and Maths β Array & Prefix Sum β Strings β Hashing
Two Pointers & Sliding Window β Stack & Queue β Linked List
Trees β Binary Search β Greedy β Dynamic Programming
β Graphs β Heap & Priority Queue β Backtracking β Trie
Focus on all _IMP files across every topic. They cover the patterns most likely to appear in a 45-minute interview round.
Found an issue or want to improve a solution?
- Fork the repository.
- Add or improve a solution using the documented problem template.
- Update the website catalog when adding a new problem.
- Run
python -m unittest discover -s tests -v. - Submit a pull request.
See CONTRIBUTING.md for more details.
MIT β free to use for learning and interview preparation.
Achal Jain Β· github.com/Achal13jain
Last updated: September 2026