Synechron interview question

how to handle stack, queue with which algorithm?