← Data Structures & Algorithms learning pathData Structures & Algorithms · Module 3 of 10
Arrays and strings
Master the most common interview data structures.
📖 Key ideas
- Arrays store elements contiguously with O(1) index access.
- Insert/delete in the middle costs O(n).
- Two-pointer technique solves many problems (pairs, palindromes).
- Sliding window handles subarray/substring problems.
- 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