The number 40 appears multiple times in the Torah and the works of the Sages, though in very different contexts:
For instance: 40 days of rain during the flood, for 40 days, Moses was on Mount Sinai, 40 days before beginning of life.
Is there any underlying principle, which would explain why the number 40 is used in all of these instances?