Amazon interview question

Test on logical reasoning