OCEAN
Dsa

Arrays and Binary Search

Master the highest-value array patterns for interviews, including two pointers, sliding windows, prefix sums, Kadane, and binary search

Why Arrays Come First

Arrays are where interview pattern recognition really begins. A huge portion of problems can be reduced to one of these questions:

  • do I need to scan from both ends?
  • do I need a moving window over contiguous elements?
  • do I need fast range totals?
  • do I need the best subarray ending here?
  • do I have a monotonic space that can be binary-searched?

Algorithms in This Topic

On this page