Implement a stack using only queue(s)
Anonymous
If you pop everything from one q into another it will still be FIFO though.. my solution is: have 2 queues, primary q and secondary q. to push object onto stack, you push it into primary q. to pop object from stack, you pop every element in the primary q except the last one (which is the most recent element pushed) and as you pop each element, you push that element into the secondary q. now the primary q has nothing but the most recent element pushed (the one to be popped by the stack) and the secondary queue has everything the primary queue had minus the element to be popped off the stack. now you designate the secondary queue as the primary queue, and the original primary queue (which is now the new secondary queue) is cleared.
Check out your Company Bowl for anonymous work chats.