Pregunta de entrevista de Databricks

Object oriented design question involving a montonically increasing stack