Tesla interview question

build a cpp class to solve a geometry problem