i've had the same problem for a year and was driving me insane (i got to a point i was shouting at the machine!!) and apple store in 3 different countries had 3 different wrong explanations of the problem.
i was first told it was the RAM so i changed them and the problem was solved for a short while, then i was told it was the hard drive which's an SSD so i changed that with a new SSD and the problem persisted, then the last apple service said it is the logic board and that i'd rather go for a new machine since the logic board is very expensive.
i got frustrated as i needed the computer for work and could not afford a new one so i resolved to go on living with the problem and try not to move the machine while working, still, typing on the keyboard sometimes would trigger the problem.
the last time i changed the SSD i forgot to tell apple service what OS version i wanted so they installed the latest which i hated so much, and also the new SSD was not as fast as the previous one so i decided to put back the older SSD since it wasn't the cause of the problem and it had the right OS version, but i didn't want to send it to apple service and pay 40$ fees so i got a screwdriver and went about replacing the SSD,.
for sometime i was suspecting bent cables or loose parts might be causing the freeze so along the process of replacing the SSD i dusted the machine, fiddled gently with cables connecting things to the logic board and made sure everything was tight in place.
i had no expectation that would work as nothing looked wrong inside the machine and i actually didn't feel like i've made any changes besides replacing the SSD and all i wanted was having the fast booting and the right OS. but to my surprise somehow the freezing problem was solved!! and now i could move around the house showing my friend the view of my balcony and can use it on my lap!!
so here's what i think, my laptop was a workhorse, i overloaded it with music production and i was using it for 6 days a week of DJing and when i'm not working i'd be downloading music, basically this machine which's a late 2009 macbook unibody was overworked, overloaded and heavily abused in inhospitable environments for over 2 years, never shut down for more than 7 hours a day when i'd be asleep, not to mention i had it second hand. so i firmly believe the parts are put together to make a wonderful machine and are meant to last very long time, so before listening to your local incompetent apple genius just go on the internet and read what others with similar experience had to say and it will definitely give you a clue as to what might be causing yours to crash, the symptoms might be similar but the solutions aren't.
if i had listened to those wankers at apple service i'd have thrown away an otherwise perfectly fine machine.