Last year, a longtime engineer at Facebook Inc. gathered data that revealed a controversial finding: Code written by women was rejected much more frequently than code written by their male colleagues, according to people familiar with the matter and screenshots of internal discussions viewed by The Wall Street Journal.

For many female engineers at Facebook, the finding confirmed long-held suspicions that their coding faced more scrutiny than men’s.

...