So my iMac decided to die on me

Last Sunday I had some time to process my latest (very special and fun) shoots, but my iMac decided not to.  It's my second one.  In 2015 I have traded my 5 year old iMac 27 for a new one with a retina display.  I never had any problems nor crashes with the old one.  Can't say that's the same with the newer version.  I can handle a software crash, but the problems I had were random shutdowns.  Quite frustrating!  Last weekend, I couldn't use my iMac for more then 10 minutes before it went to black.  Booting the computer again was not possible without physically disconnecting the power cord.  Fortunate we have a 2 year warranty here in Europe, I was good for a couple of months.  Handed my mac to the Apple store last Tuesday.  If I may take a wild guess; it's probably the logic board or a power supply problem.  I hope the same won't happen again when it's out of warranty ...