Well in anti-harrasment training they definitely tell you not to ask those questions. Search on Google for illegal interview questions and you'll get similar advice (0). Hell, I just saw an HR sign warning that asking for the name of someone's spouse is discouraged because it can be used to discover gender identity and sexual orientation. You can certainly ask these questions in an interview, but you run the risk of being sued.