Implement inventory allocation with backorders | Amazon Interview Question