Uber interview question

Programming question involving maximizing profit