Spearline Labs interview question

The assignment was bit on the difficult side.