Amazon Interview Question

logical questions