Array & HashingIndexed and keyed access
Arrays trade contiguous memory for O(1) access by position; hash tables trade a hash function for O(1) access by key. These two are the foundation of almost every program, and usually the first tool to reach for in an interview.
Why learn Array & Hashing
Where it shows upA user ID mapping to a login state, a URL mapping to cached content — both are hash tables. Redis is, at heart, one very large hash table.
→ Lesson: Hash TableCounting character frequencies, checking whether two words are anagrams, finding duplicates — a hash table turns every one of those lookups into O(1).
→ Lesson: Hash Set / Map PatternsAsked for revenue from day 1000 to day 5000? Compute prefix sums once and every later question is a single subtraction.
→ Lesson: Prefix SumA picture is a 2D array. Rotating it 90 degrees, walking it in a spiral, finding connected cells on a board — all 2D array work.
→ Lesson: Matrix