Answer by David Karger:
For me it was always in mind as an option, since my grandparents called me "professor" from age 10 or so. But I never assumed it would happen, nor considered it my only option. I recognized early that I enjoyed puzzling over creative technology problems. I didn't do any real research as an undergraduate but I enjoyed my problem sets and even more my independent projects. When I thought about the jobs that would let me work creatively in technology, most of them seemed to involve a graduate degree (at that time—some in today's startup culture argue it's no longer important). So I went there thinking it might be fun to be a professor, but that there were lots of other fun alternatives in computer science that I could pursue with a PhD. When it came time to apply for jobs, I still wasn't sure I'd be a professor, because I had no idea whether I'd get hired. I did decide that I was only interested in working at top research universities, and if I didn't get a job there I'd look for work in industry. Fortunately I lucked out. At this point I'm certain that it is indeed exactly the right job for me.
But that leads to the advice bit of this post: do not plan your life around the idea of becoming a professor. There are very few jobs at the top universities, and you need a lot of luck (unless you are absurdly talented) to achieve the kind of research results that get you noticed and hired there. You need a backup plan, or more accurately a "likely plan". Chart a course towards a kind job that you'll like and that you're pretty confident you can get. Hopefully, it will keep open the possibility of academia if things break your way. But if your plan is academia or bust, you're taking a really big risk with your future happiness.