I recently heard an amazing podcast by 99% Invisible about the former walled city of Kownloon. (Episode 66.)
Image above by Ian Lambot.
The city was a sort of symbolic “free zone” for the Chinese while Hong Kong belonged to the British. It operated sort of like a completely different country; different laws, different standards of living, etc. An island within an island. New York City now has 26,403 per square mile. Kowloon had 3.2 million. Apparently it was a sort of free-for-all in terms of municipal services: Waste Management = throw your trash out your window. Temples installed screens over their roofs to keep off the trash. (This created some great ambient lighting!) Utilities were stolen via makeshift wiring over and over. When the line was cut, they ran another one. Wires and pipes accumulated, clogging the alleys and cluttering rooftops.
Images below by Greg Girard.