Expedia Group Interview Question

How would you design a Zoo class using OO design?

Interview Answers

Anonymous

Aug 3, 2009

This seems more like a Zoo management structure than "Zoo". I'd create this by making Zoo its own class and then having other abstract classes such as Animal, Worker, Building so they cannot be instantiated directly. I'd then have subclasses for each of these, for instance, Animal may have the subclass Reptile or Mammal.

2

Anonymous

Aug 4, 2009

In addition to the above, I'll implement polymorphism in the Zoo class. i.e. declaring variables for each of the abstract classe that point to actual instantiation of the sub-classes

1

Anonymous

Oct 25, 2010

polymorphism understanding does not look normal.