Design ride-hailing pricing with fairness and pooling

Read the full interview experience this question came from →

Quick Overview

This question evaluates system design and algorithmic skills related to real-time distributed pricing, API and data-flow architecture, carpooling logic, fairness constraints, and experimentation support.

Design ride-hailing pricing with fairness and pooling

Company: Amazon

Role: Software Engineer

Category: System Design

Difficulty: hard

Interview Round: Onsite

Design and implement a pricing engine for a ride-hailing platform that maximizes company revenue while ensuring fairness to riders and drivers. Requirements: 1) Expose an API that, given a user request, returns multiple candidate routes for the rider to choose; 2) Compute a price for each candidate route using distance, duration, demand/supply, waiting time, and driver incentives; 3) Support carpooling: when a rider opts into pooling, compute the rider’s price considering shared segments and detours; 4) Enforce fairness constraints (e.g., caps on surge multipliers, equitable pricing across neighborhoods, transparent breakdowns); 5) Allow experimentation with pricing strategies and guardrails; 6) Handle real-time updates to demand and driver availability. Deliverables: a high-level system design covering components, data flows, and storage, plus pseudocode or code for the core price calculation function with inputs, outputs, and complexity. Discuss trade-offs, assumptions, and how you would validate fairness.

Overview: This question evaluates system design and algorithmic skills related to real-time distributed pricing, API and data-flow architecture, carpooling logic, fairness constraints, and experimentation support.

Read the full Amazon Software Engineer interview experience this question came from

|Home/System Design/Amazon
Amazon logo
Amazon
Sep 6, 2025
hardSoftware EngineerOnsiteSystem Design
7
0

System Design: Ride-Hailing Pricing Engine

Context

Design a pricing engine for a ride-hailing platform that maximizes revenue while ensuring fairness to riders and drivers. The system must operate in real time, support experimentation, and provide transparent price breakdowns.

Requirements

  1. API: Given a user trip request, return multiple candidate routes for the rider to choose.
  2. Pricing: Compute a price for each candidate route using distance, duration, demand/supply, waiting time, and driver incentives.
  3. Carpooling: When a rider opts into pooling, compute the rider’s price considering shared segments and detours.
  4. Fairness: Enforce caps on surge multipliers, equitable pricing across neighborhoods, and provide transparent breakdowns.
  5. Experimentation: Allow experimentation with pricing strategies and guardrails for safety.
  6. Real-time updates: Handle live changes in demand and driver availability.

Deliverables

  • A high-level system design covering components, request/data flows, and storage.
  • Pseudocode for the core price calculation function with inputs, outputs, and complexity.
  • Discussion of trade-offs, assumptions, and a plan to validate fairness.

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...