If computational thinking techniques are applied to the problem of how to bake a cake, on decomposing the problem, the solution would state – among other things – that certain quantities of particular ingredients are needed to make the cake.
For the first ingredient, it might tell us to go the cupboard, get the ingredient, and bring it back to the table. For the second – and all other ingredients – It might tell us to do the same.
If the cake had three ingredients, that would mean three trips to the cupboard. While the program would work like this, it would be unnecessarily long and complicated:
It would be more efficient to fetch all the ingredients in one go, and the program would be shorter as a result:
The solution is now simpler and more efficient, and has reduced from nine steps to five.
The problem occurred here because some steps were repeated unnecessarily, making the solution inefficient and overly long.