Hakka walled villages were made by the Hakka people in China. The buildings themselves are called "tu lou" (literally "tall earth building") and are mud, brick and stone buildings designed to be an easily defensible living area. The outer walls were 1 meter thick, had no low windows and one gate. Multiple families lived inside these buildings, and it has a plaza inside it. It's essentially an ancient village/apartment building, with different areas assigned to living quarters, armoury, temples, storage... Most rooms designed for living in were built with similar interiors, and occupied by several generations of the same family. Larger rooms would be occupied by especially large families.
Many of them were 10,000 square metres, but the biggest one found was over 40,000 square metres.