Data Foundry interview question

Question from OOP and DSA