UKG Interview Question

Coding scenario about polymorphism and inheritance