Pregunta de entrevista de Meta

Basic questions about stacks/queues. DP problem. One design round.