Capital One Interview Question

case interviews and calculating profit