Capital One interview question

Java design patterns