Pergunta de entrevista da empresa Synechron

how to handle stack, queue with which algorithm?