Question d’entretien chez Expedia Group

How would you design a Zoo class using OO design?

Réponses aux questions d'entretien

Utilisateur anonyme

3 août 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

Utilisateur anonyme

4 août 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

Utilisateur anonyme

25 oct. 2010

polymorphism understanding does not look normal.