Amazon Interview Question

I was asked some situations to test how I will solve the problem.