Usage Rollup Double-Count
The brief
You've been dropped into a Foundry-style metered-usage pipeline you did not write. It rolls up usage events into per-account totals that customers get billed on. Events arrive from a primary ingest shard and a backup shard, delivery is at-least-once, and the same event can land on both. After an on-call engineer replayed the backup shard to recover from an outage, a handful of accounts opened tickets saying they were billed for far more compute than they used.
Across five milestones you'll turn the over-billing report into a precise invariant, trace the rollup to localize where a duplicate slips through (past a plausible-looking red herring), commit to the smallest fix that restores the invariant, make the change inside the real codebase until the tests pass, then defend it and grade yourself.
Why this company
Palantir's Re-engineering round drops you into 200 to 1000 lines of code you did not write, with a subtle logical bug and a planted red herring, and watches how fast you build an accurate mental model and localize the defect. It scores comprehension and disciplined debugging over authoring. This lab mirrors that round: the fix is a couple of lines, but the signal is whether you find the real cause instead of the thing that merely looks wrong. This is the stretch end of the Palantir track. The distributed-systems framing (at-least-once delivery, cross-shard replay, idempotency) leans toward the full-time FDSE bar, so if you're interviewing as an intern, warm up on the Ontology Learning lab and the 911 Dispatch decomposition lab first and treat this as a reach. It is one round of a longer loop, so treat it as onsite prep, not the whole bar.
What you'll do
- 1ClarifyRe-engineering roundTurn the over-billing report into one precise invariant before opening a file.
- 2DecomposeRe-engineering roundTrace the pipeline and localize where a duplicate slips through.
- 3DesignRe-engineering roundCommit to the smallest fix that restores the invariant, and defend it.
- 4BuildRe-engineering roundMake the smallest correct edit in the real codebase and get the tests green.
- 5ReviewSelf-review + mission reflectionDefend the fix under the hidden case, then grade yourself.
What this prepares — and what to prep elsewhere
This lab rehearses
- Re-engineering / debugging round (orient in unfamiliar code, find a subtle logical bug)
- Reading real code under a bug report, past a red herring