Richard Nieva/CNET

SAN FRANCISCO -- How do you get more women into the technology industry?

YouTube CEO Susan Wojcicki has two answers.

In the short term, it must come straight from the leaders in Silicon Valley. The CEOs of tech companies must come up with programs and demand more diversity from recruiters, she said.

"They need to say, 'we need to do better,'" she said Thursday here during a panel at the Salesforce Dreamforce conference.

Longer term, she said computer science needs to be a requirement in schools. That way, the exposure and resources are available to everyone. (Earlier this week, New York City Mayor Bill de Blasio announced a requirement that all the city's public schools teach computer science to students.)

Silicon Valley has faced tough questions as the treatment of women and minorities in tech has become top of mind for the past several months. High-profile lawsuits and gender discrimination complaints have attracted additional scrutiny. But all this also speaks to how influential the sector has become, especially as it becomes a driving factor of the global economy and a model for employee benefits and health programs.

Google, the parent of YouTube, is not immune to criticism for its lack of diversity. The Mountain View, California-based company was one of the first big tech companies to disclose the demographics of its work force in May 2014. The company is still only 30 percent female, according to its most recent diversity report. When it comes to race, Google is only 3 percent Latino and 2 percent black.

When asked on Thursday where the women in tech were, Wojcicki said, "I'm looking for them. We're hiring."

Before she was CEO of YouTube, Wojcicki, 47, joined Google as one of its earliest employees. She famously rented out her garage to co-founders Larry Page and Sergey Brin. On Thursday, she said she charged them $1,700 a month.

She joined the company while pregnant and has recently become a champion for the benefits of maternity leave. Last December, she wrote an op-ed for the The Wall Street Journal saying that after Google extended its paid maternity leave policy to 18 weeks, the rate of new mothers leaving the company fell by 50 percent.

Other tech companies have made changes to their programs too. In August, Netflix announced unlimited paid maternity leave for the first year after birth.

When it comes to diversity, she said technology is too important to leave out women and minorities.

"Technology is changing our lives in ways that we cant even imagine now," Wojcicki said. "Technology has to become more inclusive."

"I know it will," she added.