AMD interview question

Printing a stream to stdout following this pattern