A curated collection of coding interview problem-solving techniques with explanations, examples, and Swift implementations. The goal is to start from brute force (baseline correctness) and progressively optimize using common patterns, while tracking personal learning progress.
- 📚 Learn: Understand the most common coding approaches used in interviews.
- 🛠 Practice: Solve problems in Swift (and possibly other languages in the future).
- 🚀 Optimize: Move from brute force → efficient solutions step-by-step.
- 🤝 Share: Help other developers prepare for technical interviews.
# | Approach | Status |
---|---|---|
1 | Brute Force Baseline | ✅ |
2 | Two Pointers | ✅ |
3 | Sliding Window | ✅ |
4 | Prefix Sum / Difference Array | ✅ |
5 | Hashing / Frequency Map | ✅ |
6 | Binary Search (Value/Answer) | ⏳ Coming Soon |
7 | Sorting + Greedy | ⏳ Coming Soon |
8 | Stack / Monotonic Stack | ⏳ Coming Soon |
9 | Heap / Priority Queue | ⏳ Coming Soon |
10 | Union-Find (Disjoint Set) | ⏳ Coming Soon |
11 | BFS / DFS | ⏳ Coming Soon |
12 | Backtracking | ⏳ Coming Soon |
13 | Dynamic Programming | ⏳ Coming Soon |
14 | Graph Shortest Paths | ⏳ Coming Soon |
15 | Topological Sort | ⏳ Coming Soon |
16 | Interval Sweep Line | ⏳ Coming Soon |
17 | Trie | ⏳ Coming Soon |
18 | Bit Manipulation | ⏳ Coming Soon |
Common-Coding-Interview-Approaches/
│
├── 01-Brute-Force/
│ ├── README.md # Explanation & problems
│ ├── MaxSubarraySum.swift
│ ├── TwoSum.swift
│
├── 02-Two-Pointers/
│ ├── ...
│
├── 03-Sliding-Window/
│ ├── ...
│
└── ...
- Start with Brute Force to ensure correctness.
- Recognize patterns that allow optimization.
- Implement the optimized version.
- Compare complexity and verify results with brute force.
- Move to the next approach.
Contributions are welcome! If you want to add:
- A new approach
- Example problems
- Optimized solutions Please fork the repo, make changes, and submit a PR.
MIT License — feel free to use, modify, and share.
Happy coding and interview prep! 🚀