Practice by Numbers interview question

Puzzle question and some system design concepts