Out of pretty much all the people I know, I can't think of any successful career not pivoting on one such fateful moment of "luck". One lucky question/answer, one fortunate encounter, one near miss. Of course we'll never know how the road not taken looks like. Any moment could actually be a pivotal one but most are very unassuming and only the memorable ones stick with us, making them feel more important.
Also, as someone who's been tested with this kind of questions (in the math and physics fields at least), I realized many times you aren't evaluated for knowing the answer but for how you go about trying to find it even if you fail.
This particular question is close to my heart as I was tested with it as a pupil in school. The teacher wrote this on the blackboard and asked me to come over and solve it (not having any prior knowledge). After a bit of fidgeting with the chalk I stared writing on consecutive lines 1, 1+1, 1+1+1 and after a few lines it dawned on me it looks like the "lower" half of a square of side n as cut by its diagonal. So I proudly concluded that the sum is n^2/2. Which was of course wrong, I forgot to add an n/2 to that since the "diagonal" is shifted right a bit. Still got top mark and maybe it was one of those moments that set me on a path. This went on through high-school, university, post graduate studies, and early career. It was only when I was knee-deep in real work that people started to care less about how I think and more about just the end result.
Preparing for this kind of question isn't cheating as long as you understood the answer.