Capital One interview question

OOP design, trees, string manipulation