You have to contact Apple as soon as possible.
Apple provides 90 days of free tech support from the date of purchase of a Mac.
System Preference > Energy Saver
See if the feature "Restart automatically if the computer freezes" is selected.
Thanks for your help. I cannot find the "Restart automatically if the computer freezes" in the Engergy Saver in my rMBP. Anyway, I am now running as less software as I can and found that the computer did not restart. I think may be the software "EuDic" is the problem for the restart as I did not run this software and the rMBP is o for the last 6 hours. If the computer continue to restart, I will bring back to Apple store next monday.
Do not worry about it. The best thing to do is to take the rMBP to the Apple store and either return it or exchange it for a new one.
If you want to return an item, you can ship the item back to Apple, or bring it to any U.S. Apple Store for a full refund. For eligible Mac, iPad, iPod, and third-party products, you have up to 14 calendar days from the time you receive your item(s) to initiate a return.