← Lyft Interview Insights

Lyft·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Jun 2026

Summary

A stats/probability question from a Lyft data science interview. Short and deceptively simple on the surface, but it's easy to fumble the setup if you rush.

Questions Asked (1)

Q1

The company distributes a $5 discount coupon to N riders. Each rider uses the coupon with probability P. What is the expected total cost to the company?

Product Analytics & MetricsA/B Testing & Experimentation
Author's notes

Looks trivial until you second-guess yourself mid-answer.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Recognize that each rider's coupon usage is an independent Bernoulli trial with probability P. The total cost is $5 times the number of riders who use the coupon, so the expected total cost is $5 * N * P. State this clearly and then discuss assumptions and potential extensions.

Pro tip: Mention that this is a linearity of expectation problem and that the result holds regardless of dependence between riders, but in practice, you'd also consider factors like coupon stacking, expiration, and incremental lift to assess true cost.

1. Define the random variable

Let X_i be an indicator variable for whether rider i uses the coupon, with P(X_i = 1) = P. The total cost C = 5 * sum_{i=1}^N X_i.

2. Apply linearity of expectation

Compute E[C] = 5 * sum_{i=1}^N E[X_i] = 5 * N * P. This avoids needing to know the distribution of the sum.

3. State the result

The expected total cost is $5NP. For example, if N=10,000 and P=0.1, expected cost is $5,000.

4. Discuss assumptions and extensions

Note that this assumes independence and identical P, but linearity holds even without independence. In reality, consider that coupons may be used on orders of varying sizes, and the cost might be offset by increased revenue.

Key Points to Mention

  • Linearity of expectation
  • Bernoulli distribution for each rider
  • Independence is not required for linearity
  • Expected value calculation: $5 * N * P
  • Practical considerations: coupon abuse, expiration, incremental profit
  • Potential need for confidence intervals or variance if assessing risk

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.