The city is rife with buildings with glaring flaws, like ground floors with walls or columns removed to make way for store displays, or a succession of illegal new floors added in each election period on the presumption that local officials will look the other way. On many blocks, upper floors jut precariously over the sidewalk, taking advantage of an old permitting process that governed only a building’s footprint.

Worse, Dr. Erdik said, as with a doctor’s patients, not all of the potentially deadly problems are visible from the outside, and thousands more buildings are presumed to be at risk. “Little details are very important,” he said. “To say that a building is in bad condition is easy. To say that one is safe is hard.”

Image Children displayed their readiness for an earthquake in a classroom in Istanbul. Credit... Johan Spanner for The New York Times

Some of Turkey’s biggest builders have readily admitted to using shoddy materials and bad practices in the urban construction boom. In an interview last year with the Turkish publication Referans, Ali Agaoglu, a Turkish developer ranked 468th last year on the Forbes list of billionaires, described how in the 1970s, salty sea sand and scrap iron were routinely used in buildings made of reinforced concrete.

“At that time, this was the best material,” he said, according to a translation of the interview. “Not just us, but all companies were doing the same thing. If an earthquake occurs in Istanbul, not even the army will be able to get in.”

Echoing other engineers and planners trying to reduce Istanbul’s vulnerability, Dr. Erdik said that the best hope, considering the scale of the problem, might well be that economic advancement would happen fast enough that property owners could replace the worst housing stock before the ground heaved.

“If the quake gives us some time, we can reduce the losses just through turnover,” Dr. Erdik said. “If it happens tomorrow, there’ll be a huge number of deaths.”