← Data Structures & Algorithms learning path
Data Structures & Algorithms · Module 3 of 10

Arrays and strings

Master the most common interview data structures.

📖 Key ideas

  1. Arrays store elements contiguously with O(1) index access.
  2. Insert/delete in the middle costs O(n).
  3. Two-pointer technique solves many problems (pairs, palindromes).
  4. Sliding window handles subarray/substring problems.
  5. Prefix sums answer range sum queries in O(1).
💡 Real-life example: Two pointers are two friends walking from both ends of a road toward each other.
Two pointersTwo indices moving through data
Sliding windowMoving range over data
Prefix sumCumulative sums array
ContiguousStored next to each other