Chosen Solution

My Macbook pro recently stopped booting into Yosemite and directly goes to the folder with a question mark on it. I have tried 3 things,

  1. Holding the option key while turning on to select partition to boot in
  2. Holding the command+R keys to boot into recovery mode and try to reset OS X
  3. Unplugging and re-plugging the hard drive cable When I opened disk utility in recovery mode the entire partition where my OS X would be is gone and all that is left is a 2GB recovery partition. My question is whether or not I need to get a new hard drive. Is it dead and is there anyway I can test that? I would like to be able to fix the hard drive and resort to buying a new one as last option. I realize that this problem could also be a faulty hard drive cable and I would have to change that first. Is there any way to know what my problem is specifically?

First pull the drive and use an external enclosure or a USB to SATA adapter and see if it is accessible that way. If so, replace the hard drive/IR cable with a new one from a 2012 13" model.

when its booting up, hold command and R. a globe will appear and it will say internet recovery. then it will boot into mac os utilities. click reinstall mac os and follow the onscreen instructions.