Amazon Interview Question

Mostly logic questions