ClaySys Technologies interview question

Purely based on the problem they given