Pergunta de entrevista da empresa Databricks

Object oriented design question involving a montonically increasing stack