Walmart interview question

Solve a general programming problem.