Amazon Interview Question
Software Engineer / DevelopersI would go with two base interface ,
IFurniture
{
void Init(IMaterial)
}
IMaterial
{
}
Now I will create furniture objects,
abstract class Chair : IFurniture
{
}
abstract Class Table : IFurniture
{
}
Class WoodMaterial : IFurniture
{
}
class SteelMaterial : IFurniture
{
}
Concrete classes
class WoodenChair:: Chair
{
Init(IMaterial material)
}
1) Abstract Class Furniture {
Material material;
}
2) table extends furniture
3) chair Extends furniture
4) Material
5) Wood implements material;
6) Iron Implements material;
Wood implements material; ???
I think you mean : Wood implements Material
But since Material is an interface, how can there exist an instance material ?
- Amit R January 07, 2012