Capital One interview question

core java oo principles