-Financial debt, so all of your finances are inspected
-Family connections, so all of your family is investigated
-Marital affairs, so you're asked about it during the poly
-Pirating software, again asked about it on the poly
...and all sorts of other things. The big thing you hit on is that this isn't very painful unless you try to hide it. If you try to hide something and it comes out in the investigation, you'll almost certainly be disqualified.
Also, polygraphs are pseudoscientific nonsense.
If instead they just decided that if they found out one of their employees smoked pot that they wouldn't care the coercion potential would magically disappear overnight.
But I guess that's too logical for the government to consider.
The NSA, at least, is not without imagination. They will have perceived the issue with making a stink about X causes X to be a handle for coercion. Therefore, the NSA wants pot smoking to be in issue they can disqualify people with, they want other arbitrary categories of actions to be disqualification issues. Why? My guess is control: mental health issues and sexual behavior outside of vanilla are pretty darn common. Finding such problems gives the NSA itself a handle on their own people, to coerce things from them.
And as far as "character" goes, haven't we heard enough about that in the past few years to realize that "good character" is just another form of racism/elitism, like "good breeding" or a "gentleman's C" grade at an Ivy League school?
In Germany you can only ask about drug use if the people will work with heavy machinery. No questions about race, gender, kids, or age are allowed and can be used to file a lawsuit if asked.
The federal police and intelligence agencies will also background check your friends and family. That being said, amongst German IT professionals people working for the government have the image of being a bit slow and only there for the job security. The best graduates certainly don't go there, and because patriotism/nationalism is very low the agencies cannot even advertise with "Do it for your country, if not for the money".
It'd be weird if it weren't disqualifying.
(I think it ought to be 100% legal, but until it is, users are too great a risk)
I suppose you can ask any question you like in a job interview.
It isn't that certain questions are illegal; it's that there are certain bases on which employers may not discriminate - so called protected classes of individuals[1]. If you ask someone a question about whether they are married or pregnant, you might create the perception that you are discriminating on those bases. Not delving into those areas in interviews is merely a prudent HR policy to avoid the appearance of impropriety; actually discriminating on those grounds, however, is illegal.
Job interviews are not the same as security clearance checks (which some govt/govt contractor jobs require). I don't know what if anything is "out of bounds" in the context of those...
[1]: http://www.eeoc.gov/laws/types/index.cfm
EDIT: For a bit more information on the types of questions you might run into during a clearance check, here's a PDF of the form you fill out, SF86[2]. I don't know how closely they hew to this in the in-person interviews but I've heard anecdotally that the investigators primarily clarify and confirm responses you gave on the clearance form. Note that it is 127 pages long. The first 60 or so pages are basic information about you, your relatives, your marital status, people who know you well, education, personal military history and employment. Here are some of the more interesting sections along with the page number they start on:
- Foreign Contacts (p62)
- Foreign Activities (p66)
- Foreign Business, Professional Activities, and Foreign Government Contacts (p75)
- Foreign Travel (p83)
- Psychological and Emotional Health (p87)
- Police Record (p89)
- Illegal Use of Drugs and Drug Activity (p96)
- Use of Alcohol (p103)
- Financial Record (p109)
- Use of Information Technology Systems (p116)
- Association Record (p119) features the question: "Are you now or have you EVER been a member of an organization dedicated to terrorism, either with an awareness of the organization's dedication to that end, or which the specific intent to further such activities?" along with a form which you can helpfully use to provide the name and street address of the organization as well as any contributions you made:
At a guess that question is only there so you can be prosecuted if the answer you give is in contradiction to what is already known about you. I highly doubt they actually expect to find anything new like this.
There is no compulsion to answer, however.
With the understanding that there's also no compulsion for them to hire you if you don't answer.