Capital One interview question

all questions are hard