Skip to main content
MediumBug fixJavaScript40 min

Compute-Usage Rollup Overbills a Replayed Build

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

A compute-usage rollup meters how many compute-seconds each account's transform builds consumed. Usage events are emitted by transform builds and arrive on two streams: a primary metering stream and a backup stream. Ingestion is at-least-once, and the same event id can be emitted on both streams, so the two overlap.

Incident Report

After a backfill replayed the backup build, several accounts were billed for more compute-seconds than they used. Accounts whose events landed on only one stream are fine; the inflated ones are those whose events appeared on both.

Read the codebase files, run the tests, and make the smallest fix so each distinct event id is metered once per account. Keep the public function signatures.

What this round practices

Usage metering is billing, so an overcount means customers pay for compute they did not use. Events arrive on two overlapping streams, and the round practices reasoning about identity and duplicates across sources after a backfill, in JavaScript.

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/usage-store.js
  • src/rollup.js
  • tests/usage-rollup.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 40 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.