## Amazon Interview Question

**Country:**United States

2. a) Bought 600 roses: cost = $0.3*600 = $180. Revenue = 600*(0.2 (a customer wanted exactly 600 roses) +0.3 (customers wanted 900 but i had only 600 )+05(customers wanted 1200 but again i had only 600)) = $600, profit = 600-180 = $420

b) Bought 900 roses: cost = $270. Revenue = 600*0.2 (if only 600 roses sold) + 900*(0.3+0.5) (if someone wanted those 900 roses or a customer wanted 900 but i had only 900) = 120+720=$840, profit = $570

c) Bought 1200 roses: cost = $360. Revenue = 600*0.2 + 900*0.3 + 1200*0.5 = 120+270+600=990, profit = $630

600 = 20% -> 900 = 50 % (increase) -> 1200 = 30% (decrease). so we need to find roses to but which I know I can sell 100%. This is between 900 and 1200. sales increases from 50 to 100% and then comes down to 30 with 900 to 1200. That is 130(50(100%-50%) + 80(100%-30%)) percentage of probability of sales. now divide 300(1200-900) with 130 and you will get 2.3076 roses of increase in probability. now multiple that with 50 (50% left to make sure seller can assure 100% sales on what he buy is the max profit) = 115 So add 900 to 115 will get you 1115 which is the perfect count of roses which you can buy to sell without wasting roses and also customer going back with out of stock.

600 = 20% -> 900 = 50 % (increase) -> 1200 = 30% (decrease). so we need to find roses count which I know I can sell 100% sure which is the max profit i can make. I will loose profit if customer cannot but due to out of stock, or I waste roses due to no buyer.

So now looking to probability of sales, it is between 900 and 1200. Sales increases from 50 to 100% and then comes down to 30% with 900 to 1200. That is 130 (50(100%-50%) + 80 (100%-30%)) percentage of probability of sales.

Now divide 300(1200-900) with 130 and you will get 2.3076 roses of increase in probability.

Now multiple that with 50 (50% left to make sure seller can assure 100% sales on what he buy is the max profit) = 115 which is he away from max profit.

So add 900 to 115 will get you 1115 which is the perfect count of roses which you can buy to sell without wasting roses and also customer going back with out of stock.

It is OBVIOUS that since the price & sales do not depend on volume, the case with the highest PERCENT of sales will generate the most profit:

roses cost 3.60/dozen

600 = 50 dozen, 900 = 75 dozen, 1200 = 100 dozen

cost: $180, $270, $360, respectively

sell: 20%=10 dozen, 50%=37.5 dozen, 30% = 30 dozen

revenue: $100, $375, $300

net profit: (-$80), $105, (-$60)

Lets think of the likelihood sales as demand by the people. Thus the question can be rephrased as "there is 20% likelihood that the demand will be 600 roses, there is 50% likelihood that the demand will be 900 roses and there is 30% likelihood that the demand will be 1200 roses."

- Vempati Narasimha Sai July 21, 2018if I buy 1200 roses, the investment is 360, the expected revenue will be (0.3*1000)+(0.5*750)+(0.2*500) = 775, profit = 775 - 360 = 415

if I buy 900 roses, the investment is 270, the expected revenue will be (0.8*750)+(0.2*500) = 700, profit = 700 - 270 = 430

if I buy 600 roses, investment is 180, the expected revenue is (1*500) = 500, profit = 500-180 = 320

thus I would buy 900 roses to maximise the profit and the maximum profit is 430