Ace Walmart data science interviews with a practice problem on customer coupons using probability & expected value. Solution included!
Blog
For a data-driven retailer like Walmart, understanding customer behaviours and promotional impacts is important.
One type of question Walmart data scientists can expect is calculating expected values and probabilities in real-world business scenarios.
Questions like these evaluate your ability to model situations using core statistical concepts.
Let's take a look.
If you give N users a 5$ coupon, with the probability of usage being P, what is the expected coupon spend? What assumptions would you make to underpin that answer? What is the probability that one of the coupons will be used?
To solve this problem, we need to make some assumptions and use the concepts of expected value and probability.
Assumptions:
Expected Coupon Spend: š
To calculate the expected coupon spend:
Expected Spend = Number of Users (N) * Value of Coupon * Probability of Usage (P)
Expected Coupon Spend = N Ć $5 Ć P
For example, if you have 1000 users (N = 1000) and the probability of using the coupon is 0.2 (P = 0.2), then the expected coupon spend would be:
Expected Coupon Spend = 1000 Ć $5 Ć 0.2 = $1000
This means that, on average, the company would spend $1000 on redeemed coupons if the scenario is repeated many times.
The probability that at least one coupon will be used: š
The probability that at least one coupon will be used can be found by subtracting the probability that no coupons are used from 1.
Let Q be the probability that a single user does not use the coupon.
Then, Q = 1 - P.
The probability that none of the N users use the coupon is Q^N, assuming independence of events.
Therefore, the probability that at least one coupon will be used is:
Probability (at least one coupon used) = 1 - Q^N = 1 - (1 - P)^N
For example, if you have 1000 users (N = 1000) and the probability of using the coupon is 0.2 (P = 0.2), then the probability that at least one coupon will be used is:
Probability (at least one coupon used) = 1 - (1 - 0.2)^1000 ā 0.9999999999999999
This means that it is almost certain (with a probability very close to 1) that at least one coupon will be used when distributing 1000 coupons with a usage probability of 0.2.
*****
If you're prepping for an upcoming Walmart data science interview, make sure you have a firm handle on basic statistics and probability.
You can connect with me if you want to know more about the kinds of questions Walmart asks and get some practice examples.
As someone working at Walmart, I can help you prepare for the technical as well as the behavioural part of the interview process.
Also read: š
SQL Interview Question: Retrieving Top Customers by Total Spend
Copyright ©2024 Preplaced.in
Preplaced Education Private Limited
Ibblur Village, Bangalore - 560103
GSTIN- 29AAKCP9555E1ZV