Even though you don't specify it, I believe you are talking about ancient Egypt, since a high percentage of the population of ancient Egypt were farmers, and when they were not farming they were doing other jobs. Specifically during the flood season they were not able to farm so it was then when they worked for the pharaoh on building projects.