Relativity Interview Question

Implement a Triangle class

Interview Answer

Anonymous

Dec 7, 2016

I had already implemented a Square class and suggested an abstract class to represent a base Shape class. In the base class, there would be two properties: height and width. There would be a default method called Area that would calculate the generic Area of a shape. Then they wanted a Circle class, but a circle isn't calculated the same, so the properties didn't make sense. I then implemented an Interface. -- The interface question was a good answer.