I have a late 2013 15 inch MacBook Pro I bought off Amazon used. It has a core i7 2.0 Ghz processor and 16 GB of RAM. It's running Mac OS Sierra 10.12.4. The battery cycle count is 414.
The problem is that it randomly shuts down without any notice. Usually, the screen goes black but the keyboard shows light for a few seconds before it completely shuts down.
Interestingly, I have been using it in a clamshell mode quite a lot and it has never shus down in that particular mode.
Till now I have tried:
Reinstalling OS from scratch
Can anyone offer any other suggestions?