Moka (Indonesia) interview question

Basic logic