Amazon Interview Question

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