When the shaking from the Himalayan earthquake reached Kathmandu just before noon on April 25, the Nepalese capital was filled with buildings—hastily constructed, poorly built—that were filled with people.

Saturday's earthquake may have caught Nepal by off guard, but that doesn't mean it came as a surprise. "You have a massive plate boundary system going under the country of Nepal," says Janise Rodgers, a structural engineer with Geohazards International, a Palo Alto nonprofit that helps developing countries earthquake-proof their infrastructure. Experts like Rodgers expected the quake because Nepal sits astride a massive continental subduction zone.

And the resulting devastation came as no surprise, either, because Kathmandu is filled with buildings not made to stand up to a quake. "Seeing modern, vulnerable construction go up without engineering input, building codes, or thought to earthquake design made a lot of people very worried," Rodgers says. The details of earthquake mitigation vary from building to building, but the general principles are:

1. Build on bedrock (not sloppy sediment).

2. Tie buildings together so they won't be easily knocked over.

3. Use steel, or something similarly strong, to reinforce concrete buildings.

Proximity to a fault line puts cities in danger of earthquakes. Other accidents of geography can exacerbate a trembler1, but you can predict a city's real risk using a much simpler metric: net worth. "In Nepal, you have a rapidly growing population that is very poor, and has basic shelter that is unsafe rather than shelter that is earthquake safe that they can't afford," says Simon Klemperer, a seismologist at Stanford University.

The scary part? Kathmandu isn't unique. It's impossible to predict an earthquake with reliability, of course, but when I asked seismologists what places they worried about the most, these three were among the most compelling examples of places at the intersection of geology and economics.

Mexico City, Mexico

Even though the Mexican capital is hundreds of miles from any fault lines, it is one of the most seismically threatened cities on the globe. If a quake strikes the coast, people living above the dense bedrock between the Pacific and the capital might only feel a slight tremble. But the capital sits atop an infilled lake, which traps and amplifies seismic waves. And before 1957, the city did not require buildings to be earthquake compliant. Since then, semi-regular tremblers have knocked down a lot of dangerous dwellings (some of which were rebuilt with quake reinforcement), but in the same period the city's perimeter has expanded with shantytowns.

On the plus side, Mexico City has a pretty nice early warning system. It 2012, when a 7.4 quake hit the coast 200 miles away, the alarm gave many Capitalinos precious seconds to find their way to safety.

Istanbul, Turkey

Like Kathmandu and Mexico City, this ancient city connecting Europe and Asia is filled with poor people living in poorly built structures. Unlike those other places, Istanbul is right on top of a dangerous fault zone. "The North Anatolian fault is a similar type—strike-slip—to California's San Andreas fault," says Rodgers. And as with its North American twin, experts have been predicting a minimum 7.0 magnitude quake on the North Anatolian for years. But Istanbul does not have anything near California's stringent earthquake codes. The last quake to hit the city—a 7.4 magnitude—killed more than 17,000 people. In the Golden State, the Loma Prieta quake—of comparable strength—shook up the Bay Area, but only killed 63.

New Madrid, USA

On the surface, the middle parts of America do not seem like candidates for seismic disaster. But 200 years ago a small town in southeastern Missouri was the epicenter of several huge earthquakes, some of which reached up to 8.0 magnitude. The strongest of these quakes altered the course of the Mississippi River. But because the region has been so quiet in the past century or so, building codes were never brought up to snuff. In 2008, FEMA issued a warning that a modern earthquake of the same magnitude (the odds are around 7 to 10 percent in the next 50 years) would cause, "the highest economic losses due to a natural disaster in the United States."

Bringing buildings up to code—at home or abroad—is costly, but economics is just the language we use to measure the true cost of disaster. "When you’re talking about earthquake mitigation, you’re talking about lives you’re saving," says Rodgers. "That’s where the real value is: You’re protecting lives." In other words, we should start picking up buildings before they fall down.

1. Kathmandu was built in a huge, bowl-like basin atop young, sedimentary rocks. When the quake struck, the basin focused the seismic waves onto the city, which propagated through the soft sediments at amplified levels.