Yes, I do have children. Why do you ask?
"How often are you asked if you have kids in a job interview?" I asked my husband.
"Never," he replied.
"I'm asked about half the time."
"Isn't that illegal?"
In a word, yes. It is illegal. And my experience is not unique. In the Elephant in the Valley survey, 200 women with at least 10 years of experience in Silicon Valley were asked a variety of questions about being a woman in tech. A whopping 75% were asked about family life, marital status and children in interviews.
In my completely informal survey of random men I ran across in my office (and to be perfectly clear, I was not asked this, or any other illegal questions, during my interview at my current employer), exactly 1 out of 10 had been asked this question. Several of the men I asked were concerned that I might be unaware this was illegal, and one of them stopped a passing HR team member to reinforce that this was in fact illegal. All of them were incredulous that I had ever been asked that question.
In my personal experiences, every time I have been asked if I have children in a job interview, it has been by a man. Most often, it has been asked by a C-level. In my most egregious example, I was asked if I had kids, if I was married, and what my husband did for a living, followed by complete horror by the male C-level interviewing me who discovered that I had two kids, a husband who worked at a startup, and I was going business school at night. "I don't know how you are going to manage all that," he replied. Considering I was already doing those things, while working full time at an early stage start up, I seemed to be managing things just fine. My husband was also managing things just fine, but that was neither relevant, or apparently in the realm of possibility for this interviewer, whose wife did not work outside the home (yes, I asked.)
While my initial reaction to be asked this question has been horror and annoyance, I now embrace it. Please ask me an illegal question during the interview. In fact, please reveal to me any and all ethical transgressions your business may be doing during a job interview. It is really hard to understand the culture and character of a company during an interview - you look at the values, mission statement, ask questions about the culture, but really, you are just getting a glimpse into the real core of the values and ethics of the company. If you ask me an illegal question, at a bare minimum I'm learning that you either don't have an HR department, or you don't have interview training at your company, OR that you are completely aware that the question is illegal and you are asking it anyway. Any of those things are excellent information for me to have while deciding not to work for your company.