Qureight interview question

Walk through the task solution. What could you do to improve the solution?