"Have you ever worked for the federal government?"
This question is part of a company's pre-screening questions. Why ask this question? What are they trying to establish?
There are conflict-of-interest rules that prevent, for example, former Contracting Officers from taking jobs with the companies whose contracts they oversaw while working for the government. If an applicant previously worked for the federal government, the company will need to ensure they don't violate any of these rules. If the applicant never worked for the federal government, then then obviously these don't apply.
The response to this question should not be used on its own to qualify or disqualify any particular applicant to any particular position. It is rather used as part of a checklist by the company to ensure that it performs the necessary due diligence.
If they ever do business with the government, this may affect what projects or roles they can or should assign you to.