Pregunta de entrevista de Expedia Group

How would you design a Zoo class using OO design?

Respuestas de entrevistas

Anónimo

3 ago 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

Anónimo

25 oct 2010

polymorphism understanding does not look normal.

Anónimo

4 ago 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