Pregunta de entrevista de Yubi

Question includes array and stack. In the managerial round LLD was asked