Pergunta de entrevista da empresa Expedia Group

How would you design a Zoo class using OO design?

Respostas da entrevista

Sigiloso

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

Sigiloso

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

Sigiloso

25 de out. de 2010

polymorphism understanding does not look normal.