But the need for such equipment became painfully apparent the day after Hurricane Sandy hit. Around the city, 26 of the housing authority’s basement boiler rooms had flooded, destroying the equipment there, and leaving 34,565 apartments without heat and hot water. The electrical systems of many buildings, already in marginal shape because of delayed maintenance, were also devastated by flooding. Having power restored would not be enough: in about 95 buildings, temporary generators and boilers would be needed until the electrical systems could be rebuilt.

Water stopped flowing in many high-rise buildings above the sixth floor. Stairwells and hallways were pitch black. But because there was no up-to-date survey of electrical needs, the Army Corps of Engineers, called in to help install generators five days after the storm, first had to visit 100 authority buildings simply to determine what kind of generator each needed.

The Kentucky-based company Ware Inc, which provides temporary boiler rentals, was asked for help on Nov. 2 — four days after the storm, said Steve Taylor, an executive. The company searched nationwide for available boilers, and it took another week before all the boilers were delivered, some from as far as Texas.

Even after the boilers arrived in the city, installing them took more time than it should have. Mr. Taylor, who flew to New York to help, said city officials repeatedly attempted to reuse motors damaged in the flood, something he knew was not going to work.

“Two or three days passed, and we were burning up a lot of motors that they thought would run,” Mr. Taylor said. “We were chasing each other around.”

City officials said there was no way around the slow start-up: simply drying out the basements had taken nearly six days, in spots like the Red Hook housing complex, where the ground was so saturated that the basement had to be repeatedly pumped out. And Mr. Taylor agreed once the work got under way, the city pushed it hard, assigning so many contractors to the job, there was physically no more space on the ground for more personnel to be added.

Incomplete Plans

As much of a struggle as it was to restore services, the city’s effort to get food and medical help to those trapped — and even grasp just how many people were in peril — was even more fraught.