Last Friday, Anna and I were driving Wan Fokkink and Moshe Vardi to the Blue Lagoon. During the trip, Moshe asked us how we ended up choosing the areas of research we work in. His tenet, if I recall it correctly, was that serendipity and the influence of the people we meet at crucial points in our career are decisive, and we really do not choose consciously an area per se.
It turns out that the person who triggered Moshe's research interests in databases, the area of research he started his career in, was Catriel Beeri, who taught a course at the Weizmann Institute as a guest lecturer when Moshe was a student there. One of the papers that Beeri gave his students to read contained the statement of an open problem that Moshe worked on and solved. The rest is history. Moshe's collaboration with Pierre Wolper was instead triggered by the decision that they would share a room at a conference in order to save money. This led to the research that won them the Gödel Prize 2000 and the Paris Kannellakis Award for 2005!
Wan holds an MSc in Mathematics, but, despite liking the subject very much, he found research in that field "a lonely affair." He was about to go out and work in industry when a PhD position in Computer Science became available in Jan Bergstra's group. Chris Verhoef, who had studied mathematics with Wan's brother, suggested that Wan would apply for that position, and Jan Bergstra was obviously very convincing during the interview :-)
Anna also holds an MSc. in Mathematics, but she had to take a minor in a related subject. The subject was Computer Science and her project supervisor was a young and very keen Kim G. Larsen. Kim's supervision was so inspirational that Anna switched to Computer Science, and worked out a characteristic formula construction for bisimulation equivalence over finite LTSs together with two fellow students.
As for me, I heard Ugo Montanari mention during a course I liked a lot that "The semantics of concurrency was a difficult and active area of research." Without any specific reason, I decided that that would be the topic of my MSc. thesis. This turned out to become reality when I met Rocco De Nicola, who had just come back to Pisa after finishing his PhD thesis at Edinburgh under the supervision of Matthew Hennessy. Matthew and Rocco eventually became my mentors.
I would not be surprised if many of my readers have a similar story to tell. The people we meet and learn from do shape our interests and our attitude to life in research. That's one of the reasons why we should give a good example to young researchers.