⭐ Star this repo if it helps you crack your interview!
98 curated problems · 15 topics · Interview-focused patterns · Python 3
| 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 |
Completion: 100% (98 / 98 problems)
| # | 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 | 3 | 0 | 4 |
| 05 | Two Pointers & Sliding Window | 1 | 1 | 1 | 3 |
| 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 | 1 | 0 | 1 |
| Total | 33 | 54 | 11 | 98 |
Note: TreeNode.py in the Trees folder is a shared helper class, not a problem.
Counts verified programmatically: 98 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 common subsequence (hash) · Custom data structure design · Count distinct elements in window
Two sum (sorted) · Max element in sliding window · Maximum consecutive ones
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)
├── 01. Basic and maths/ (8 problems)
├── 02. Array and prefix_sum/ (17 problems)
├── 03. Strings/ (9 problems)
├── 04. Hashing/ (4 problems)
├── 05. Two pointers & Sliding window/ (3 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/ (1 problem)
├── index.html — filterable visual index
├── PATTERNS.md — signal → technique cheat-sheet
└── DATA_STRUCTURES.md — requirement → data-structure chooser
- Clone the repository
git clone https://github.com/Achal13jain/Topic-wise-DSA-Imp-questions-Python.git cd Topic-wise-DSA-Imp-questions-Python - 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.
_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 solutions (match the existing file format)
- 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: June 2026