Macquarie Group interview question

some basics OOPs question and basic dsa question