Castle maps are random in Medieval. All you can do is take into account the terrain. Castles in mountain provinces will often have one or more unassailable sides, for instance.

Also: maybe you mean how do you know what buildings and units exist in the neighbouring province. A spy or watchtower will suffice in this case.