Buckhill interview question

I needed to solve an algorithmic problem using PHP that involved queues, under time constraints set by the testing platform.