Expedia Group interview question

Rod cutting problem, standard DP problem