Shell interview question

Event loop and small coding challenge