Design a Dynamic Pricing Engine

System Design
Hard
Uber
33K views

Design a service that uses machine learning models to dynamically set prices for products (e.g., flight tickets, ride-hailing). Focus on model deployment and A/B testing price points.

Why Interviewers Ask This

Interviewers at Uber ask this to evaluate your ability to balance complex algorithmic logic with real-world business constraints. They specifically test your understanding of how machine learning models integrate into high-throughput systems, your awareness of the risks associated with price volatility, and your strategy for validating model performance through rigorous A/B testing before full deployment.

How to Answer This Question

1. Clarify requirements by defining scope: Are we pricing rides globally or a specific city? Define latency constraints (e.g., sub-200ms response) and data freshness needs. 2. Outline the data pipeline: Detail how you ingest real-time supply/demand signals, historical traffic patterns, and external factors like weather or events. 3. Design the core architecture: Propose a microservices approach where a feature store feeds a pre-trained ML model, ensuring the inference engine scales horizontally during peak hours. 4. Address safety and fairness: Discuss guardrails to prevent price gouging and ensure driver earnings remain viable. 5. Explain validation: Describe an A/B testing framework using multi-armed bandits to safely roll out new price points to small user segments before global release.

Key Points to Cover

  • Explicitly addressing latency constraints critical for ride-hailing contexts
  • Describing a concrete data ingestion pipeline using streaming technologies
  • Integrating business guardrails to prevent algorithmic bias or price shocks
  • Proposing a sophisticated A/B testing strategy like Multi-Armed Bandits
  • Defining clear success metrics beyond just revenue, including conversion and retention

Sample Answer

To design a dynamic pricing engine for Uber, I would start by clarifying that the system must handle millions of requests per second with sub-second latency while ensuring revenue optimization without alienating users. F…

Common Mistakes to Avoid

  • Focusing solely on the ML algorithm while ignoring the engineering infrastructure required for real-time inference
  • Neglecting to discuss how to handle edge cases like sudden demand spikes or network failures
  • Overlooking the importance of A/B testing and suggesting a direct, risky full-scale rollout
  • Ignoring the human element by failing to mention driver incentives or rider satisfaction safeguards

Sound confident on this question in 5 minutes

Answer once and get a 30-second AI critique of your structure, content, and delivery. First attempt is free — no signup needed.

Try it free

Related Interview Questions

Browse all 190 System Design questionsBrowse all 57 Uber questions