Complexity optimization is a generally useful skill.
"moving the goal posts" is called "every month at work, when you finish 1 task and then move on to another task, instead of going home and getting paid to rest on your laurels"
I don't think it has to be "wrong". If I were asking this question, and I was provided with "store them in a hash", I would say something along the lines of "that's a correct solution" and then add additional constraints.
"How you adapt in the face of additional constraints" is very much relevant to programming.