Iterable interview question

There were two coding problems with 90 min to complete