They both used the feudal system. The feudal system is a kind of culture in which the knights (in Japan, Samurai) owned most of the land and were responsible to the King (in Japan, Emperor), and basically ruled over the peasants. Hope this helped:)
Both Japan and Europe had landowning and non-landowning castles, they both used hereditary castle systems, people born peasants had no chance of becoming anything other than peasants, almost all castles had: moats to discourage building of tunnels, portholes to use as guns and a main gate that could be used as a trap.