// TOPIC

#arrays

9 articles

Beginner
01

Arrays and How Memory Really Works

Go under the hood of the most fundamental data structure — contiguous bytes, O(1) index addressing, cache lines, and why a sequential scan beats a random walk every time.

#arrays#memory#fundamentals
10 min
BeginnerAmazonGoogle
02

Strings

Strings are immutable arrays hiding an O(n²) concatenation trap. Learn the sliding window, two-pointer, and hashing patterns that crack string interviews.

#strings#arrays#fundamentals
13 min
BeginnerAmazonGoogle
03

Arrays

The data structure everything else is built on. Why arr[i] is instant, why inserting in the middle hurts, and the handful of patterns that turn arrays into interview wins.

#arrays#fundamentals#data-structures
8 min
◆◆IntermediateAmazonGoogle
04

Prefix Sums

Precompute running totals so any range sum becomes one subtraction. The prefix sum technique turns O(n) per query into O(1) — and the hashmap combo unlocks a whole class of subarray counting problems.

#arrays#prefix-sums#techniques
10 min
◆◆IntermediateAmazonGoogle
05

Monotonic Stacks

Master the monotonic stack — the O(n) pop-while trick behind next greater element, Daily Temperatures, Largest Rectangle, and Trapping Rain Water.

#monotonic-stack#stack#arrays
14 min
◆◆IntermediateAmazonGoogle
06

The Merge Intervals Pattern

Master the merge intervals pattern: sort by start, sweep once, and crack meeting rooms, calendar conflicts, and range overlap problems in O(n log n).

#intervals#sorting#greedy
12 min
◆◆IntermediateAmazonMeta
07

Cyclic Sort

Cyclic sort: the O(n) time, O(1) space pattern for arrays holding values 1..n — swap each value to its home index, then scan for missing numbers and duplicates.

#arrays#sorting#patterns
11 min
◆◆IntermediateAmazonMeta
08

The Two Pointers Pattern

A sorted array and an O(n²) instinct — two indices, moving in tandem, collapse it to O(n). Here is the pattern, the tell that signals it, and every problem variant you will see.

#two-pointers#arrays#sorting
11 min
◆◆IntermediateAmazonGoogle
09

The Sliding Window Pattern

Learn the sliding window technique: solve longest/shortest subarray and substring problems in O(n) with the expand-right, shrink-left template.

#sliding-window#two-pointers#arrays
11 min