Amazon Interview Question
Software Engineer / DevelopersI think we can use visitor pattern here - Stress class is the visitor, furniture class is the object and chair n table extend it
Furniture class has implementation pointer to material class (wood, metal extend them)
Now in ur test function u can pass furniture ptr and stress ptr
The use of this pattern is that we can increase the instances of stress class easily
- champion May 12, 2010