UKG interview question

Coding scenario about polymorphism and inheritance