5th Avenue in NYC is a lot smaller than San Francisco, though. There are also a great number of apartments within commutable distances of 5th Ave. I have never been to SF, but my knowledge of American culture leads me to believe that there must be a Walmart somewhere in SF.
There are actually no Walmarts in San Francisco. However that doesn't answer the root of your question; there are similar jobs (target, dishwashers, supermarkets, etc). Most would live in the east bay, sunset or South Bay -- about 25 minutes east, west or south of SF, respectively.
As to your first point, 5th Ave is smaller, but also more expensive. SF is bigger, but relatively cheaper. It's a sliding scale; both driven by scarcity of land compared to desirability.
Wow, I didn't know that. Being from Europe and having only visited the US once (East Coast), I had the impression they were everywhere.
New York has a working mass transit system, though. For poor people this makes the world of a difference. I remember that, when I lived in Madrid a few years back, I was impressed by how fast you could go _everywhere_ in that city with the subway alone. A cross-town morning commute in that 3Mil Juggernaut took about as long as the cross-town car-commute in a less developed 130K city I had lived in before.
Walmart has some office space in San Bruno (engineers). I think the nearest Walmart is about 17.5 miles from SF (specifically, 101 meeting 80) in the outskirts of Oakland.
And actually there are more affordable rooms in commuting distance (BART or car) than it appears from popular opinion online.
Yes and a Target too. And the rent at the apartment towers next to it are $4000+. So, being next to a Walmart even isn't exactly a means of 'living cheaply'
Where do the people working in that Walmart live?