LTM Limited interview question

Write queues structure program with O(n)