Skip to main content
HardBug fixJavaScript50 min

Rate Limiter: Bursts Slip Past the Plan Limit

A practice debugging interview round in JavaScript. Reproduce the failure in an unfamiliar codebase, narrow down the cause, ship a minimal fix, and explain your reasoning to an AI interviewer.

The incident

The API gateway caps how many requests a customer plan may reserve within a rolling window. The store is a small in-memory stand-in for a Redis sorted set, keyed per client, holding request timestamps.

Incident Report

Requests that trickle in one at a time are capped correctly, but a burst fired all at once reserves more than the plan allows, so two accounts exceeded their per-minute quota during spikes. Billing is disputing the overage.

Read the codebase files, run the tests, and make the smallest fix so a burst cannot reserve past the limit. Keep the public function signatures.

What this round practices

A limiter that works for steady traffic but leaks under bursts is a common production surprise. The round practices building a reproduction that fires requests together, reading the store's contract closely, and explaining why the sequential tests never caught it.

Files you will work in

These 5 workspace files open in the in-browser editor when you start the round. Hidden tests also run when you submit.

  • task.md
  • README.md
  • src/window-store.js
  • src/rate-limiter.js
  • tests/rate-limiter.test.js

What you are assessed on

The scored report evaluates both your investigation steps and what you explain during the conversation, not only whether the final test run passes.

  • Reproduction
  • File navigation
  • Evidence gathering
  • Hypothesis
  • Root-cause understanding
  • Regression prevention
  • Patch scope
  • Verification
  • Edit control
  • Communication clarity

How the round works

You get 50 minutes in a JavaScript workspace that runs in your browser, with no setup. Talk through your plan with the AI interviewer by voice or text, run the tests as often as you like, and submit when the visible checks pass. Hidden tests run on submit, and the scored report covers what you did and what you explained.

Ready to debug this codebase?

Open the workspace, run the failing check first, and walk the AI interviewer through your findings.