// TOPIC
#two-pointers
3 articles
◆◆IntermediateAmazonMeta
01Fast & Slow Pointers (Cycle Detection)
Two pointers moving at different speeds — the tortoise and hare — detect cycles, find the middle of a linked list, and locate cycle starts, all in O(1) space. The single most-asked linked list technique in FAANG interviews.
#linked-lists#two-pointers#cycle-detection
12 min◆◆IntermediateAmazonMeta
02The 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
10 min◆◆IntermediateAmazonGoogle
03The Sliding Window Pattern
Learn the sliding window technique to solve "longest/shortest/contains" subarray and substring problems in O(n) instead of O(n²). Covers fixed and variable windows, the expand-right-shrink-left template, and the classic bugs.
#sliding-window#two-pointers#arrays
10 min