In the ancient Near East, a fair amount of the territory is arid, seaside land. Floods were a common occurrence, and fear of a total deluge is entirely understandable. Most societies in the area would have had such stories, but very few written records exist. The Mesopotamian Epic of Gilgamesh and the Bible's book of Genesis are two of them.
In Gilgamesh, book (or tablet) 11, Utnapishtim is assigned by one god named to save people and animals from the imminent flood that the arguing gods are going to inflict. His reward for his success is immortality for him and his wife alone. The boat is described as 120 by 120 by 110 cubits.
In Genesis, God tells Noah to save the people and pairs of animals—"two of every kind, male and female." God gives him specific information on how to build the boat, including the wood (cypress) and size (300 by 50 by 30 cubits).