OnMobile interview question

Some random question to check logic