I'm really surprised that nobody has pointed out that your 4 rounds of rejection have all been in the most competitive city in the world for software developers. I am a software developer of average skill who lives in the midsouth and I swear to god I can't get recruiters to leave me alone. Have you considered expanding your search beyond the SF area? NYC, Chicago, and Atlanta all have world class tech scenes and are not nearly as competitive as the Bay Area. Nashville and Charlotte are rapidly evolving into tech centers as well, with relatively low cost of living.
Giving up on the software industry because you couldn't hack it in SF is like giving up on the NFL because you were a second round draft.