The only real pattern seems to be "bought their guns legally" and had some crime or mental illness history. Aaron Alexis even tried and failed to get treated twice. Making mental health services accessible and free-of-charge might have improved at least five of those scenarios.
There were two or three shooters that could have been prevented if the background checks hadn't failed in some way.
What would've stopped Vester Flanagan? The shooting was his first crime. (There were some indications he was an asshole, but no charges or mental problems.) This is why people think that these shootings are never going away.