Bank of America interview question

some oop, was quite easy