Domanda di colloquio di Synechron

how to handle stack, queue with which algorithm?