Design Ride Subscription

Medium35 min
1 / 30
understanding9 min read

Problem Statement: Ride Subscription & Pass Platform

Problem Statement: Ride Subscription & Pass Platform — ride subscription interview depth

Problem Statement: Ride Subscription & Pass Platform

Ride subscription products (Uber Pass, Lyft Pink, Citibike annual) sell predictable mobility spend instead of one-off fares. Uber Pass-style monthly bundles that discount or cap ride spend while integrating with the core trip and pricing stack.

ConcernDesign stance
Money pathCard vault via PSP; platform never stores PAN
Truth sourceAppend-only entitlement_event + subscription_period snapshot
Trip hookPricing service calls Entitlement API before fare lock
AbuseVelocity limits + device graph on activation

Capacity anchor (order 1): ~13M paying subscribers in launch regions; peak 40k redemptions/s when evening commute overlaps billing-cycle renewals.

javaOne Dark Pro
1public record EntitlementHold(String holdId, String userId, String tripId, long planVersion, int remainingRides) {}
pythonOne Dark Pro
1def apply_pass_discount(base_fare_cents: int, pct_off: int, cap_cents: int) -> int:
2 discount = min(int(base_fare_cents * pct_off / 100), cap_cents)
3 return max(0, base_fare_cents - discount)
typescriptOne Dark Pro
1export interface RedeemRequest {
2 tripId: string;
3 idempotencyKey: string;
4 planVersion: number;
5}

Deep dive (sec-001)

Trace redemption T-1-440: subscriber opens app, Entitlement service reads period P-44017, balance shows 3 rides left, trip completes, ledger records debit with idempotency key IK-sec-001. Finance exports tie to Stripe invoice inv_44017.

On-call triad: redemption_duplicate_rate, webhook_lag_seconds, negative_balance_alerts — any sustained duplicate > 0.01% triggers P1 because it is direct revenue leakage.

Interview pivot: If interviewer asks pooling, answer phase-2 household ledger with delegated sub-accounts; MVP stays single-user entitlement namespace tied to user_id.

Why interviewers care

Ride Subscription interviews reward crisp scope, explicit trade-offs, and failure stories—not generic microservice diagrams.

Interview checkpoint

Name one failure story for Problem Statement: Ride Subscription & Pass Platform that proves you understand real outages, not happy-path diagrams.

Key Highlights

  • Ledger idempotency on trip_id (sec-001)
  • plan_version locked at hold creation (1)
  • Webhook dedupe before entitlement grant (understanding)
  • Finance export matches Stripe invoice (1)
pro tip
Pass sec-001: Always bind redemption to trip_id + idempotency key before mutating balance.
interviewer loves
Pass sec-001: Mention plan_terms snapshot so mid-cycle policy changes cannot rewrite history.
common mistake
Pass sec-001: Treating subscription balance as a single UPDATE counter—events must be append-only.
trade off
Pass sec-001: Prepaid ride pools increase breakage revenue but complicate partial refunds on cancel.

Section Rescue Kit

Buzzwords to use:

Entitlement ledgerPlan version pinning

Safe statements:

  • "Before naming databases for Problem Statement: Ride Subscription & Pass Platform, I'll quantify redemption QPS and webhook volume."
  • "I'll separate money movement (PSP) from benefit movement (ledger) in the whiteboard."
Design Ride Subscription - System Design | WinJob | WinJob