There's always the option of not taking the hackathons that seriously. The one I did some stuff for I popped in in the morning, found out what it was about, went home a wrote some code for about 6 hours and then popped back the next day to present. My team mates were non coders. We didn't do to bad though not in the top 10%. It was quite fun though. I'm noticeably over 39.5 and think I'll skip the all night there stuff.