Interview patterns

Practice the reusable decisions behind common coding interview problems instead of memorizing isolated solutions.

Which state can be reused instead of recomputed?

Choose by the decision you want to understand

Each lesson names the situation it fits and the behavior worth watching.

Sliding Window visualizer preview
Start hereExpand and shrink a range

Sliding Window

Choose it when
Contiguous subarrays and substrings
Watch for
Each boundary moves forward while running state avoids rescanning.
Explore Sliding Window
Two Pointers visualizer preview
BeginnerCoordinate two indices

Two Pointers

Choose it when
Pairs, partitions, and in-place edits
Watch for
Pointer movement follows a condition that safely removes candidates.
Explore Two Pointers
Fast and Slow Pointers visualizer preview
IntermediateMove at different speeds

Fast and Slow Pointers

Choose it when
Cycles, middles, and repeated mappings
Watch for
Relative speed reveals structure without storing every visited position.
Explore Fast and Slow Pointers
Top K Elements visualizer preview
IntermediateKeep a bounded heap

Top K Elements

Choose it when
Ranked streams and frequent values
Watch for
The heap stores only candidates that can still finish in the top K.
Explore Top K Elements
Prefix Sum visualizer preview
IntermediateCarry cumulative state

Prefix Sum

Choose it when
Range sums and subarray counts
Watch for
Two cumulative boundaries can replace repeated traversal.
Explore Prefix Sum
Merge Intervals visualizer preview
IntermediateSort and sweep ranges

Merge Intervals

Choose it when
Scheduling and overlapping spans
Watch for
Sorted starts turn overlap detection into one forward pass.
Explore Merge Intervals