## Common Coding Patterns
### 1. Two Pointers
Used for: Sorted arrays, palindromes, pair sums
### 2. Sliding Window
Used for: Subarrays, substrings, maximum/minimum in window
### 3. Binary Search
Used for: Sorted arrays, search space reduction
### 4. BFS/DFS
Used for: Trees, graphs, shortest path, connected components
### 5. Dynamic Programming
Used for: Optimization, counting, decision problems
### 6. Greedy
Used for: Activity selection, interval scheduling
## During the Interview
1. Read the problem carefully (2 min)
2. Ask clarifying questions (1 min)
3. Discuss approach with interviewer (3 min)
4. Code the solution (15-20 min)
5. Trace through examples (3 min)
6. Discuss complexity (2 min)
All Resources
IntermediateCodingDSAInterview
Coding Interview: Patterns & Strategy
Master the most common coding interview patterns and learn how to approach problems systematically.
14 min readUpdated 2025-03-10
Pro Tips
- ✓Start with brute force, then optimize
- ✓Communicate even when stuck
- ✓Practice on a whiteboard or plain text editor
Common Mistakes
- ✗Memorizing solutions instead of understanding patterns
- ✗Not testing with edge cases
FAQ
Related Guides
Get jobs in your inbox
Weekly digest of the best fresher opportunities. No spam.