Pergunta de entrevista da empresa Databricks

I was asked an OOP problem. Not too difficult but need to write test cases and run everything.