Unified Infotech interview question

About some logic based