Shell Interview Question

Event loop and small coding challenge