I did a prelim-surgery intern year. The hours are worse than medicine, but there are way less "mandatory" activities (no lectures, no endless rounding, etc.). For the most part, you're on the floor waiting for pages. I used the time between pages to write code.
Now I'm a radiology resident and have much more time.