Panamax Infotech interview question

Algorithms were asked, made to write logic of a code