Problem Statement: Splitting a Moving Fare Across Unequal Riders
Frames carpool expense splitting as a telemetry-driven accounting problem, not a flat division of a single bill.
Problem statement
Design a carpool expense splitting system that computes what each passenger owes when several people share one vehicle but board at different points, alight at different points, and occupy the vehicle for different durations. The fare is not one number divided equally. It is a function of the route each passenger actually consumed: distance traveled, time in the vehicle, attributable wait time, applicable base fare share, tolls, and any dynamic multiplier in effect while they were on board.
The system must segment the ride route per passenger, compute each passenger's consumed share of distance and time, apply a jurisdiction and product-specific split policy, present a preview before and during the ride, finalize the fare within seconds of completion, charge each payer through a payment service provider, post every movement to an immutable ledger, and support disputes and adjustments without ever double-charging.
Why this is harder than it looks
A naive design treats the fare as a pizza bill: total divided by heads. That breaks immediately in a real carpool. Passenger A rides 2 km, passenger B rides 11 km, and passenger C joins for the last 4 km after the vehicle detoured to pick C up. Equal split overcharges A, undercharges B, and nobody knows who should pay for the detour. The hard problems are therefore:
- Route segmentation under imperfect GPS: boarding and alighting happen between pings, in tunnels, in urban canyons.
- Fairness semantics: proportional-to-distance, proportional-to-time, hybrid, or game-theoretic allocation of shared and detour costs.
- Money correctness: rounding remainders, partial failures across payers, idempotent retries, and an audit-grade ledger.
- Latency: riders expect the final number quickly after arrival, and drivers expect settlement certainty.
Public operating baseline versus design assumptions
Public figures establish the scale of the surrounding category. Uber reported roughly 11.6 billion trips in 2024 and about 160 million monthly active platform users, and its engineering blog describes the Fulcrum GPS service handling more than one million location updates per second. Lyft reported a record 729.7 million rides in 2024 across about 24 million active riders. BlaBlaCar reports more than 100 million registered members for long-distance carpooling. Splitwise, the expense-splitting reference, reports tens of millions of users splitting billions of dollars of shared costs. Waze Carpool, by contrast, was shut down in 2022, a reminder that carpool economics are fragile and the settlement layer must be cheap to run.
For capacity planning this answer assumes a mature regional carpool product: 3.5 million shared rides per day, 8 million passenger legs per day, an average of 2.3 riders per ride, and a 5x commuter peak. Unless a number is tied to a named public source, it is an explicit design assumption.
The four architectural planes
- Telematics plane: GPS ingestion, smoothing, map matching, and authoritative route reconstruction.
- Fare computation plane: route segmentation, split policy evaluation, rounding, and fare finalization.
- Settlement plane: split charges, authorizations, captures, refunds, double-entry ledger, and driver payout inputs.
- Governance plane: disputes, adjustments, audit evidence, fraud controls, and compliance retention.
A strong answer keeps these planes separate. Telematics may degrade without corrupting the ledger, settlement may retry without re-deriving the route, and a dispute may adjust a fare without rewriting history.
Key Highlights
- •The core difficulty is per-passenger route segmentation plus money-grade accounting, not dividing one total.
- •Assumed scale: 3.5M shared rides/day, 8M passenger legs/day, 2.3 riders/ride, 5x commuter peak.
- •Uber reports ~11.6B trips in 2024 and its Fulcrum service processes 1M+ location updates/sec.
- •Four planes: telematics, fare computation, settlement, governance.
- •Telematics degrades gracefully; the ledger never tolerates inconsistency.
Section Rescue Kit
Buzzwords to use:
Safe statements:
- "I will separate route attribution from money movement, because they fail differently and need different consistency."
- "Before choosing storage, let me define which computations must be exact and which may be approximated."