This story is part of Solving for XX, a CNET special report exploring what people and companies are doing to make the tech industry more diverse, more equitable and more welcoming to women.
When Pooja Mehta entered her first robotics competition, in February, she saw a familiar sight: a room packed mostly with boys.
Mehta and her sixth-grade teammate were the only all-girl duo in the 18-team regional Science Olympiad Robo Cross competition. They placed 10th.
Even as an 11-year-old, Mehta knows not many girls want to learn engineering and programming. But Mehta always did -- thanks in part to watching her father, Ash, CEO of PatientClick, a company focused on electronic medical records.
"My dad used to work on the computer all day and I'd be, like, 'Hey dad, can you teach me all that?'" she says. Yet even with the support of her family, she didn't feel she could tackle something as complex as robotics or programming.
"I thought it was too hard for me or I couldn't do it," Mehta says. "It was too much work." That changed after Mehta attended Qcamp, a two-week program for girls hosted by San Diego-based chipmaker Qualcomm that taught coding, app design and robotics.
"Qcamp was the one place that I found other girls like me," said Mehta, who speaks in quick, short bursts as her mind jumps from thought to thought -- from robotics to the fun of programming to one day becoming the CEO of her own software company. "Before, I'm the only one doing this. Everyone else thinks it's stupid. Now I know there are other girls that are just as much interested as me."
Qcamp and programs like it could be the levers that ultimately tip the tech industry's gender imbalance. The reason, say observers: Too few women work in tech because too few women graduate with STEM (science, technology, engineering math) degrees. The key is to get girls interested in those subjects while they're young -- and to keep their interest through college.
"If I had not been exposed to this field when I was young, I would not have chosen it," says Twitter software engineer Sharon Ly, who volunteers as a mentor for Girls Who Code, a nationwide organization that aims to teach coding to 1 million adolescent girls by the end of the decade.
At the end of last year, 3,000 girls had completed one of its programs, and 95 percent of them went on to major in computer science, the organization says.
That success rate isn't remotely typical.
While 74 percent of middle school girls say they're interested in STEM, just 0.3 percent of high school girls choose computer science as a college major, according to Girls Who Code. As a result, the number of first-year undergraduate women majoring in computer science plummeted 64 percent between 2000 and 2012, according to the National Center for Women and Information Technology. As of 2012, women represented just 18 percent of all computer science graduates in the US.
So why are so few women pursuing STEM degrees? Educators and other experts say girls and young women will often retreat into a shell when sitting in a classroom dominated by boys.
"In high school, I didn't really know any other women coders," says Kat Slump, a 19-year-old sophomore studying IT innovation at the University of Nebraska at Omaha. "It wasn't that big of a deal, especially with six or seven people [in the entire advanced placement class]."
Yet in Slump's first two years of college, she saw the number of female coders drop dramatically after the introductory courses. The disparity began interfering with her studies. "Put me in a room with 25 males and I'm the only female, I won't ask the normal questions. I'll wait until after class, or try to figure it out on my own," she says.
Slump's experience in class highlights the need to change how schools teach computer science, says Maria Klawe, president of Harvey Mudd College and a Microsoft board member.
"If you're a technical woman working in an institution -- whether it's a company or academy where 85 or 90 percent of the people in your role are male -- even with the best of intentions there's going to be a lot of experiences where you feel like an outsider," Klawe says. "If you don't feel a sense of belonging, if you don't feel like you're being supported, you're more likely to leave."
Harvey Mudd and Carnegie Mellon University are trying to change that through education reform. At Harvey Mudd, undergrads can wait until the end of their sophomore year to declare a major, even one as intensive as computer science.
The school also included more women in its brochures, added more female campus guides and revised its introductory courses to emphasize programming as an outlet for creative problem-solving -- not just theory or brute-force computation. Carnegie Mellon eliminated programming experience as an admissions requirement and established mentorship programs for women.
The result: both schools have seen skyrocketing computer science declarations. In the last four years, the number of female computer science majors at Harvey Mudd tripled, and women now represent two out five students in the department. At Carnegie Mellon, women represent more than 40 percent of all incoming freshman to the School of Computer Science -- its highest percentage ever.
"One of the things that happens when you make an effort to make a learning and work environment really supportive -- independent of gender -- is you get a lot more people," Klawe says.
Coding camps do more than teach girls to program. They also help girls form lasting networks of friends and peers who support and encourage each other. The value of that benefit can't be overstated.
"I always thought of myself as a humanities person. Math isn't one of my favorite subjects, it's something I do because I have to," says Sophia Taylor, a 17-year-old junior at Oakland Technical High School who attended a Girls Who Code program last summer at Stanford University. Her group created an app that combined elements of photography with a game -- a sort of Snapchat meets scavenger hunt.
Sophia now plans to major in computer science. More than that, she and a friend who also attended a Girls Who Code program have started a computer science club that meets weekly after school. Together, they teach programming to other girls.
Slump says she became more assertive in class after participating in College Code Camp, hosted by mobile-payments company Square. Think of it as a four-day boot camp where female programmers hear from industry leaders, learn the basics of new programming languages and build projects to help nonprofit organizations like Children's International.
She now has a network of other women to whom she can turn for advice and support. "I wish every woman could go through that camp," Slump says, "because they would come out so empowered."
Slump has since started a meet-up at her school for women interested in working in tech. And because they're based in Omaha, where traditional tech jobs are scarce, Slump wants to help her classmates prepare for job interviews on the West Coast.
Companies like Square and Twitter say this support network is just as crucial in the workplace, where women will face an inevitable disparity.
"The composition numbers are one thing, but I also try to focus on the quality of your experience -- that's the retention piece," says Twitter's Ly. "Not just bringing women in, but making sure they want to stay, making sure they don't leave."
In other words, it's more than strength in numbers. It's strength from numbers, too.
Solving for XX
reading•Girls just want to code. The trick is making sure they don't stop
Mar 20•Entrepreneurs press VC industry to diversify its ranks
Mar 20•Female scientists making headway in kids' imaginations
Mar 20•The woman who quit cosplay to make video games
Mar 9•International Women's Day feels the effects of #TimesUp