The other day I had a 2012 MacBook Pro which when switched on would boot up to a question mark. A persistent question mark indicates that there is an issue with the hard disk which is preventing the MacOS from loading.
I removed the hard drive and connected it to my Windows PC and ran CrystalDisk Info which showed the hard drive to be in good health. This meant that the problem was with the logic board or the cable that connects the hard drive to the logic board. I ordered a new cable for around £20 and fitted it. I then connected the hard drive to it and the Mac booted up without any problems.
The Mac was running very slow so I upgraded the hard drive to a 480GB SSD. Before doing this I did a time machine backup as this would make it easier to reinstall apps and copy personal files and photos back.
Once the new SSD was installed it was a case of installing MacOS High Sierra from a USB and then running time machine. The Mac now runs really well which for a 2012 model is pretty amazing.