Pregunta de entrevista de Synechron

how to handle stack, queue with which algorithm?