Yeah, I was blown away by the opportunities available at Stanford (that he made the most of) to work and hobnob with internet luminaries. It really seemed to add jet fuel to his trajectory.
Of course it's not the only cognitive attribute that's important (I don't know of any evidence that ability to get things done correlates with g).
BTW, realized that the article didn't explicitly state that the computer science class was introductory, which changes things somewhat.