I get random crashes and hang-ups after 2-3 hours of use, and then after I restart my MacBook Pro, I get this flashing folder with question mark inside.
I tried resetting PRAM/NVRAM and SMC but nothing works. It's kinda hard to replicate the problem because it happens randomly. Right now it's working fine and I'm able to post this question from my MacBook. I even tried First Aid in Disk Utility and it was not able to find any problem.
Although it only happened 2 times while I'm doing programming in Visual studio Code (I don't know if it's related). I'm concerned if this is a hardware or software problem, it could be an installation issue or sign of a failing SSD.
I tried diagnostic and it sees no problem. I also tried Internet Recovery (Alt + Command + r + p) but my Internet connection was so slow, I always get error 2106f.
Right now it's working fine, so if I hold Option key during startup, I can see and select my Macintosh HD. But when it crashes and I get the folder with question mark I don't see my Macintosh HD.
I wasn't sure guys if this is a hardware or software problem.
And one more thing, whenever I get this folder with question mark, there is a high pitch sound coming from the right side of my laptop, I wasn't sure if it's coming on right speaker or right fan. The sound is high pitch, and whenever I heard that sound I knew that my computer hang-up and I will get this folder with question mark.
Update: I suspect that maybe this is related to CPU/GPU/logic board or temperature problem, I don't know. So I went to the website:
to test the GPU. I opened Google Chrome and visited the website, and it caused my MacBook to heat up and suddenly it freezes. So I shutdown my mac and the folder with question mark appeared again.
Here is the photo after it freezes:
Here's the specs of my MacBook Pro:
15" mid 2015 with Radeon graphics.
16 GB RAM
512 GB SSD
macoS Mojave 10.14