Problems › Topics › Sliding window
Sliding window practice problems
Keep a moving stretch of the data and update it instead of recomputing. A pattern: a move you make, and the kind of thing an interview is really asking you to spot. 9 problems in the bank train it, each with a worked example, a hint and a reference solution.
Start a Sliding window session →
- Math
- Strings
- Arrays
- Hash maps
- Sorting
- Parsing
- Two pointers
- Sliding window
- Prefix sums
- Stacks
- Binary search
- Intervals
- Grids
- Greedy
- Recursion
- Simulation
- Bit manipulation
9 problems
- Decide each call against a rate limithard
- Longest stretch with no repeathard
- The peak in each windowhard
- The longest run with only two kindshard
- The quickest way to fill the orderhard
- Should the alarm go offmedium
- Peak request burst in a sliding windowmedium
- The busiest stretch of the daymedium
- How often the load crossed the linemedium