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:

  1. Greedy Algorithm - Assignment problems, Interval scheduling
  2. Two Pointers - Opposite pointers, Sliding window, Fast-slow pointers
  3. Binary Search - Standard search, Boundary search, Search on answer
  4. Sorting - Custom sorting, Quickselect, Bucket sort
  5. Prefix Sum - Subarray sum, Contiguous array
  6. Stack and Queue - Parentheses matching, Monotonic stack
  7. DFS - Grid search, Cycle detection, Memoized search
  8. BFS - Shortest path, Multi-source BFS
  9. Dijkstra - Weighted graph shortest path
  10. Dynamic Programming - Linear DP, String DP, Knapsack, Stock problems
  11. Divide and Conquer - Merge K sorted lists
  12. Trie - Prefix tree, Word search
  13. Topological Sort - Course scheduling
  14. Union-Find - Connected components, Cycle detection
  15. LRU Cache - Hash map + Doubly linked list
  16. 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!