Sliding Window
Everything on SkillVeris tagged Sliding Window — collected across the glossary, study notes, blog, and cheat sheets.
14 resources across 1 library
Interview Questions(14)
What is the Sliding Window Technique?
The sliding window technique maintains a contiguous subrange of an array or string, expanding and contracting its boundaries as it scans, to solve subarray or…
How Do You Find the Number of Subarrays That Sum to K?
You solve subarray-sum-equals-k in O(n) time by tracking a running prefix sum and a hash map of how many times each prefix sum value has occurred so far, since…
How Do You Find the Maximum in Every Sliding Window of Size K?
You solve sliding-window-maximum in O(n) time using a monotonic deque that stores indices in decreasing order of their values, so the front of the deque is alw…
Minimum Window Substring: How Do You Solve It?
Minimum window substring is solved with a variable-size sliding window and two hash maps: expand the right pointer until the window contains every required cha…
Longest Substring Without Repeating Characters
The longest substring without repeating characters is found with a sliding window and a hash map that stores the last seen index of each character: expand the…
What is the Monotonic Queue Technique?
A monotonic queue is a deque that keeps its elements in strictly increasing or decreasing order by evicting from the back any element that can never again be t…
How Do You Find a Subarray With a Given Sum?
For arrays of non-negative integers, a sliding window expands and shrinks two pointers over the array to find a contiguous subarray summing to a target in O(n)…
How to Design an API Rate Limiter
An API rate limiter design centers on a shared, low-latency counter store (typically Redis) that tracks per-client request counts using a sliding-window or tok…
How Would You Design a Top-K Trending System?
A top-K trending system continuously ranks items (like hashtags or search terms) by recent activity using a streaming pipeline that maintains approximate count…
What Are the Main Rate Limiting Algorithms?
The main rate limiting algorithms are token bucket, leaky bucket, fixed window counter, sliding window log, and sliding window counter, each trading off burst…
Fixed Window vs Sliding Window Rate Limiting: What Is the Difference?
Fixed window rate limiting counts requests in discrete, non-overlapping time buckets like “per calendar minute,” while sliding window rate limiting evaluates t…
What is Windowing in Stream Processing?
Windowing is the technique of grouping an unbounded stream of events into finite, time-bounded or count-bounded buckets so that aggregations like counts, sums,…
How Do You Implement Rate Limiting Across Multiple Servers?
Distributed rate limiting means enforcing a shared request budget for a client across many stateless application servers, which requires moving the counter or…
What Are Common API Rate Limiting Strategies?
API rate limiting caps how many requests a client can make in a given time window, most commonly implemented with token bucket, fixed window, or sliding window…