Travis,
That does go a step further, although I would still want something deeper than that--again for non-junior programmers. The multiple inheritence answer, along with your comment about unwanted behaviors are both "book" type answers--what you would learn reading a basic Java or SCJP book. I want to see deeper design knowledge.
I guess the answer I would want would be somehting like:
What is the purpose of the class? It should have some primary funcationality, and a fixed, consistent means of implementing that functionality. I would pick the parent class that is closest to this. If there is more than one potential parent class, I've got two cases. Case 1, the parent classes are similar. In this case, I'd ask myself if I can combine the parents into a single class. More likely, the parent classes are disimmilar, case 2. Then why am I trying to combine two disimilar functions/implementations into one class? I would examine the propsed child class to see if I can and should break it into two classes.
Well, I really wouldn't expect such a complex answer in an interview. I guess I would summarize that as: a class should extend a class based on how it's implemented; it should implement interfaces based on how it's used by other classes.
This, of course, is a very general answer, and there may be cases where it doesn't hold true.
This, btw, is a example of what I mean when, in other postings to this forum, I comment that SCJP is not enough. SCJP focuses on the mechanics of how Java works, but not on when or why to do something.
--Mark
hershey@vaultus.com