So I just had a job interview and they gave me a list of tasks that they wanted me to work on beforehand. I finished all of the tasks except for one and was wondering if anyone could shed some light on the question.
The question went something like this
- Create a class called Human, give the class a public property HairColor and a public method Talk() that, when invoked, returns "I am a human."
- Create another class called child that inherits from Human and overrides the talk method and returns "I am a child."
- Create a male and female class that override talk and output "I am a Male." and "I am a Female."
- Change the child and human hierarchy to include male and female appropriately and output the proper string.
I completed tasks 1-3 but was stumped on question 4. I haven't really done much in my past work experience with inheritance and the question seemed kind of vague to me. I explained this to the employer and they seemed ok with it, but didn't tell me how it should have been done. Its been bugging me now and I'm wondering how it is done.