Can't speak for them, but its not super common so they're isn't going to be one answer that represents all doctors in this niche.
For me: Got CS degree in undergrad, worked as a SWE full time for for 2 years, did OSS and some consulting work in med school (0-20hrs/week). Now my work is primarily clinical as a resident ~65 hrs/week, with just 5-10hrs/week on programming.
Been hacking away on projects and programming since I was 7 years old (covering engineering side). Medical school came later as a backup and also a passion, but also because my vision to impact a billion people seems most attainable through the combination of innovation in tech+healthcare.