Capital One interview question

case interviews and calculating profit