Most candidates brute-force this in O(n·k) and hit TLE. Learn the monotonic deque invariant that reduces it to O(n) — with a step-by-step dry run, the five common bugs that break implementations, and why this pattern unlocks Jump Game VI and Constrained Subsequence Sum.
Find the maximum in every sliding window of size k using a monotonic decreasing deque. O(n) solution that Google uses to test understanding of amortised data structures.
Simulate a snake game on a grid where the snake eats food to grow and dies if it hits walls or itself. Uses a deque for O(1) head/tail and a set for O(1) body collision checks.