You don't even have to be as extreme as your example (nobody could work in the conditions that you mentioned).
Things like blind resume screening have been shown to significantly reduce hiring bias, and more companies should be doing it.
Also, the biggest discrimination problems in tech aren't even direct hiring discrimination problems. One big reason why companies are not very diverse is that companies tell their employees "refer your friends!" and then they are surprised when the white men only refer other white men.
Making efforts to specifically reach out to women, and making sure they apply to your company (without lowering any bars or anything), work very well in increasing diversity.