Amazon interview question

About how would I go about creating a model for this problem.