Thanks to an imaging technique called optical spectroscopy, it is possible for hatcheries to accurately determine the sex of a chick within four days of an egg being laid. This non-destructive method picks up on differences in the fluids contained in an egg from which a cockerel will develop, compared to one from which a hen will hatch.