Amazon interview question

some basic questions on logical thinking