OpenBook
  • Problems
  • Tracks
  • How it works
  • Pricing
Start practicingSign In
Problems/Commerce & Billing

12. Delivery Cost Dashboard

Easy

A driver payout service under-pays short deliveries. Fix it, then add live totals, payout cutoffs and peak concurrency.

45 minute budget71.3% acceptancedebugging · time math · aggregation

How this problem works

A small TypeScript library with a bug. Part 1: make the failing tests pass without touching tests/. Parts 2 to 4 unlock in order as each part's public tests pass. In a mock interview the product owner asks for a plan before each part, and the grader reads your answer.

  1. 1Fix short-shift pay
  2. 2Live total
  3. 3Pay up to a cutoff
  4. 4Peak simultaneous drivers

Part 1: Fix short-shift pay

  1. 01Drivers report that very short deliveries pay nothing, and a shift a little over a minute long pays for exactly one minute.
  2. 02Pay is the shift's full duration in seconds times the hourly rate in cents, divided by 3600, rounded to the nearest cent.
  3. 03The duration shown on the dashboard is still meant to be whole minutes. Do not change how it is displayed.

What the hidden tests check in Part 1

  • A 59-second and a 61-second shift pay different amounts.
  • Half-cent amounts round to the nearest cent.
  • A shift that crosses midnight is paid for its full length.
  • A ten-hour shift pays exactly ten times the hourly rate.

Hints for Parts 2 to 4 appear in the workspace as each part unlocks.

Sign in to start

Attempts, files and transcripts are saved to your account so the grader can review how you worked.

Sign inCreate an account
OpenBook

Practice for interviews where you build a feature with an AI assistant.

Early preview. Problems, grading and the interviewer are still changing.

Practice

  • Problems
  • Tracks
  • How it works
  • Pricing

Legal

  • Terms
  • Privacy
© 2026 OpenBook.