Infosys interview question

Implement a real life example using class and inheritance