Introduction
This is a comprehensive algorithm interview guide covering 40+ classic problems with detailed analysis and template code. The guide is organized by algorithmic patterns and prioritized by company focus (Google, Meta, Amazon).
What’s Covered
The guide includes the following topics:
- Greedy Algorithm - Assignment problems, Interval scheduling
- Two Pointers - Opposite pointers, Sliding window, Fast-slow pointers
- Binary Search - Standard search, Boundary search, Search on answer
- Sorting - Custom sorting, Quickselect, Bucket sort
- Prefix Sum - Subarray sum, Contiguous array
- Stack and Queue - Parentheses matching, Monotonic stack
- DFS - Grid search, Cycle detection, Memoized search
- BFS - Shortest path, Multi-source BFS
- Dijkstra - Weighted graph shortest path
- Dynamic Programming - Linear DP, String DP, Knapsack, Stock problems
- Divide and Conquer - Merge K sorted lists
- Trie - Prefix tree, Word search
- Topological Sort - Course scheduling
- Union-Find - Connected components, Cycle detection
- LRU Cache - Hash map + Doubly linked list
- Bit Manipulation - XOR tricks, Counting bits
Key Features
- Priority Labels: Problems are labeled with company focus (G=Google, M=Meta, A=Amazon) and priority levels (P0/P1/P2)
- Template Code: Reusable code templates for each pattern
- Detailed Analysis: Step-by-step problem breakdown and complexity analysis
- Interview Tips: Communication strategies and edge case handling
Full Document
Click the link below to view the complete guide:
Algorithm Interview Comprehensive Guide (Full Document)
Good luck with your interviews!