FA-85560 / Ride-hailing fare and surge pricing / Member archive
Shared price rounded up against the rider · case 05
Discounted prices are a cent higher than quoted whenever the discount leaves a fraction.
Case contract
In a shared ride, a rider counts as matched if they shared at least min_overlap_s seconds with another rider; a match needs at least two such riders, otherwise nobody is matched. Matched riders pay solo x (100 - discount_pct)% and unmatched riders pay solo x 95%, both floored to the cent in the rider's favor. Return id -> price.
Why this case matters
Ride-hailing prices are computed per trip at scale; ordering, unit and boundary slips become systematic over- or under-charging.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: rider-favorable rounding | {"r0": 1900, "r1": 1173, "r2": 2380} | {"r0": 1899, "r1": 1172, "r2": 2379} | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗