Kaar Technologies interview question

Logical reasoning