Amazon Low Level Design round| Bangalore

Write code that will be used by a Shopping cart service to enforce rules on the order

eg. Offer free 2 day shipping on orders > 125 Offer free 2 hour shipping for prime customer that have > $25 and the items are grocery items

Make this extensible to add other rules in the future Apply a 10% discount if an item has been marked for subscribe and save

I was thinking of creating a Shopping cart class and create one prime member class and other non prime member.
interfaces for Shipping speed calculator and one for discount calculator
What should be best design for this

Comments (11)