Remember
- Both ends are first class: a deque is a stack and a queue at the same time.
- Every operation is O(1) because it only touches one end and never shifts the middle.
- Sliding window maximum and work stealing both rely on popping from one end while pushing at the other.