There may just be something wrong with your specific hardware and/or install of Mac. A company like Apple who sources so much hardware straight from manufacturers in China is bound to have some issues here and there. I've had a number of recent MacBook Pros and they've been fine... never seen a sudden restart. I'm even using the Developer Preview of El Capitan. Try exchanging it.