Without any individual behaving incorrectly in any way, it feels awkward to be the only technical female in a company. Having a non-zero number of other women present is better than none, but it's completely different from having a non-zero number of equally technical women. When the information flow of technical information is always male-to-female, it just makes me feel uncomfortable, even though no one is doing anything wrong.
(genuinely curious, I have no idea how I'd try to solve it in a large company context)
I don't think I had anything useful to tell them at the time, and I'm still don't have especially clear ideas on how to solve the problem. Both companies are full of very nice, very smart people. They weren't doing anything wrong that I could see. It seems to me that the problem might be advertising.
They might be (unintentionally) advertising in male-dominated spaces (online or otherwise). This might be somewhat counteracted by the fact that both companies support/advertise-at specifically for-tech-women events (sponsoring a Girl Geek dinner; attending the Grace Hopper conference job fair).
Another possible factor is that both companies are known for having challenging interviews. (like a lot of well respected tech companies) It's possible that some potential female applicants talk themselves out of applying; I've seen (male) friends come pretty close to talking themselves out of applying because they felt they wouldn't get the job.
This is also something of a circular problem. The lack of female developers makes them less appealing places to work for potential new female hires; the imbalance signals that there might be problems at the company and the situation is a problem in itself. The company might also be less likely to hear about female-focused events to advertise at.
I don't claim to have a solution. I just wanted to back up that have enough women in general around does not really help with a lack of technical women.
Obviously that's not the case for every company. Ultimately, if 90% of developers in the country you're in are male, it's going to be pretty damn hard to keep any kind of balance in your development team. I think you just have to accept that, and continue to hire based on excellence rather than trying to bias towards gender (which is illegal anyway).
However, there are completely legal things you can do to try and tilt the balance in other functions, so that at least the company as a whole is balanced. For example, advertising on sites that aren't themselves predominantly male, and wording your job ads so that they make it clear that women are most welcome, helps to tilt the balance of applicants, which allows you to maintain the company balance while still hiring the best applicants.
I don't think you can solve macro-societal issues like gender balance among software developers in general just by tweaking your hiring process (though I'll be happy to be proven wrong), but that's not an issue of sexism, just an issue of reality.
I haven't yet considered how you'd solve that problem at huge scales, like if you were Microsoft - probably others might have more useful opinions on this. My points above are more relevant to smaller companies. I'm sure there's a number of people at Microsoft worrying full-time about this.