Indus Valley Partners interview question

Scenario based question regarding parent and child class