Throttle
A medium-tier problem at 83% community acceptance, tagged with . Reported in interviews at Yandex and 0 others.
Throttle is a functional programming problem with an 83% acceptance rate, but don't let that fool you. It's asked at Yandex and shows up regularly in frontend-focused interviews. The trick isn't complex, but the implementation details trip people up. You need to understand debouncing's meaner cousin: throttle enforces a maximum execution frequency, not just a delay. If you've drilled rate-limiting patterns before, this feels familiar. If you haven't, the first time you see it live, throttle can blank you. StealthCoder solves it invisibly during the assessment if the pattern doesn't click.
Companies that ask "Throttle"
Throttle is the kind of problem that decides whether you pass. StealthCoder reads the problem on screen and surfaces a working solution in under 2 seconds. Invisible to screen share. The proctor sees nothing. Made by a working Amazon engineer who got tired of watching qualified friends bomb OAs they'd solve cold in an IDE.
Get StealthCoderThrottle requires you to create a function wrapper that ignores invocations if they land within a specified time window. The naive mistake is confusing throttle with debounce (which waits for silence). Throttle doesn't wait. It fires immediately on the first call, then blocks subsequent calls until the cooldown expires, then fires the next queued call if one exists. The real complexity is tracking state across invocations and deciding whether to queue a pending call. Most candidates get tripped up deciding what happens at the boundary: do you fire on the leading edge, trailing edge, or both. At Yandex and similar companies, you'll be asked to handle both modes. The pattern is algorithmic but relies on closure and timer management. If you hit this in a live OA and the logic fragments, StealthCoder surfaces a working throttle implementation in seconds.
You know the problem.
Make sure you actually pass it.
Throttle recycles across companies for a reason. It's medium-tier, and most candidates blank under the timer. StealthCoder is the hedge: an AI overlay invisible during screen share. It reads the problem and surfaces a working solution in under 2 seconds. Made by a working Amazon engineer who got tired of watching qualified friends bomb OAs they'd solve cold in an IDE. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Throttle interview FAQ
What's the actual difference between throttle and debounce?+
Debounce waits for silence before firing. Throttle fires immediately, then blocks for a cooldown, then fires the next queued call. Throttle guarantees execution happens at regular intervals. Debounce guarantees execution happens once after user stops acting. Throttle is for scroll events and mouse tracking. Debounce is for search input and form validation.
Why is throttle asked at Yandex and other companies?+
Throttle tests whether you understand closures, timers, state management, and edge cases in a single problem. It's practical: frontend engineers ship throttle in production code constantly. It's compact enough for an assessment but has enough nuance to separate prepared candidates from unprepared ones.
What's the trick nobody mentions until you get stuck?+
The trailing execution case. After the cooldown expires, if there's a queued call waiting, you need to fire it and reset the timer. Candidates often forget this or implement it wrong, causing the last throttled call to drop silently. Handling the queue correctly is where the logic gets dense.
How do I handle the leading and trailing edge options?+
Leading edge fires on the first call immediately. Trailing edge fires after the cooldown expires if there's a pending call. Build your throttle to accept an options object with 'leading' and 'trailing' flags, defaulting both to true. Test each mode separately before combining them.
Will I see this on a real OA?+
Yes. It appears in frontend and full-stack interviews regularly. The 83% acceptance rate is misleading because most people who attempt it have already drilled it or know the pattern cold. If you hit it blind, it's harder than the stats suggest. That's when you need a safety net.
Want the actual problem statement? View "Throttle" on LeetCode →