The giants of Silicon Valley — Google, Twitter, Facebook and Yahoo — report that three to four percent of their workforce is black or Hispanic, and men outnumber women by more than two to one.

But now, tech companies are investing hundreds of millions of dollars to address the racial and gender imbalance. All Star Code, a nonprofit in New York partnering with Google, is training a new generation of software coders by providing young men of color with mentors, industry exposure and intensive training in computer science.

In an interview with PBS NewsHour Weekend, Marcus Mitchell, Senior Engineering Director at Google and adviser to All Star Code, says it’s part of the company’s aim to close the opportunity gap between young men of color and the tech industry.

This Q&A has been edited for space and clarity.

KARLA MURTHY: How did you get interested in the tech field?

MARCUS MITCHELL, Senior Engineering Director at Google: I got interested in college. I started college thinking that I wanted to be a physics major. But I took a course on artificial intelligence, and I took that course at the same time that I took a course on linguistics.

The combination of the two — the prospect of trying to figure out ways to get computers to do interesting things that you usually associate with only humans and human intelligence, that was really interesting to me.

KM: How would you describe the amount of diversity you’ve personally seen in the tech industry over the years?

MM: In the areas where I’ve worked, you see few women, few Hispanics, few blacks. This was true when I was in graduate school at Cal Tech. This was true when I was working at a tiny startup. This was true when I was working at a medium-sized startup. And it’s true working at Google as a big company.

One of the things that’s nice now is that there’s a lot more data and people are starting to get comfortable talking about it, so you can have a little more of a conversation about where you want to change things. But we have a long way to go.

As somebody who’s worked at a range of company sizes, you know, one of the biggest things that we think about and care about is talent and how you get more of it and how you motivate people, how you inspire them to work on hard problems and to be more productive.

And so I think, to me, the driving interest is in getting more, digging deeper into the talent pool that’s out there. For groups that are underrepresented in technology, I view those groups as places where I can find more talent that’s not being used.

KM: So do you see it more as a pipeline problem, that we’re not bringing in enough people, or not looking at where the candidates could possibly come from?

MM: It’s too simplistic to think of it as just a pipeline problem, and a lot of the press focuses on that aspect. There is partially a pipeline problem.

There’s also questions of how you retain folks in the workplace, how you make sure that you have a fair and inclusive workplace, so that people feel comfortable. Some of the kinds of work on looking at high performing teams at Google has shown that one of the number one characteristics of a high performing team is that the team members feel comfortable and safe, and they’re able to trust the people around them. They’re able to feel like they can be themselves.

And so that’s something that really benefits everybody when you can create an environment like that. So it’s not just a pipeline problem, although increasing the size of the pipeline is an important part of what we need to do.

KM: What has it been like for you personally as a black man in this industry?

MM: It’s been a lot of luck and support by key people, starting with my parents, both retired now. My dad was an architect, my mom was a scientist for the Food and Drug Administration, so I was kind of in an environment that really encouraged thinking about math and science.

But I’ve just had enough experience with it that I’m used to it, used to being, let’s say, the only black person or one of the few black people in a certain environment, and at Google.

And, you know, it’s something that you can adapt to, like so many other situations. I’ve adapted.

KM: A company like Google has been hugely successful and innovative, up to this point at least, without being very diverse. How do you explain that?

MM: Well, I mean this is where I think my personal take and motivations on this maybe diverge from some of the standard narrative. So I’m interested in the research that says that diverse teams perform better.

And I think that it’s an important pillar of what companies like Google and other companies should be thinking about. But, like I said before, I’m interested in finding talent and channeling it into areas that I’m interested in that either wouldn’t ordinarily be found or might go into other other places. That’s the key thing.

So we look at a company like Google that’s been very successful without being diverse. And why? Because it’s had a number of very talented people who were in the right place at the right time and had the right combination of preparation and creativity that they brought to the table with the opportunities that were afforded them, and they were able to do incredible things.

And so my take is we can have even more of that. We’re missing out on opportunities by having this industry be less accessible to women and folks from under represented groups.

KM: How important is it for you to be a role model for students like the ones at All Star Code?

MM: It’s very important to be a role model. And this is something that you know, my thinking on this has evolved over time. Like a lot of things, you know, you have different approach when you’re in your 20s versus when you’re in your 40s.

I think, you know, I was more self centered frankly, when I was younger, and probably less introspective about the role that folks like my parents or other role models had played in my own life. And that’s something that I feel like I’ve thought more about lately.

So one of the reasons why I get involved with groups like All Star Code and other groups is because it can have a big impact on young people to see folks who look like them, who have some similarities in background to them but who are able to be successful in areas that they might have thought were less accessible to them.

KM: The students there now are working on problems surrounded by their peers and people who look like them. What’s going happen when they come to a place like this and they’re not going to be surrounded by people who look like them?

MM: To some degree, they’re going to have to get used to that, because that’s the reality of the technology industry and the kinds of jobs that they want to go into. One of the things that we do is maintain connections between the students. So for example, after last year’s summer intensive, a number of the All Star Code students got together on their own to organize a Hack-a-thon.

And so that was a result of the connections that were forged in the context of the program. With any luck, that kind of connection will continue so that, even if you have a group of 20 students or 40 students that end up getting dispersed to different colleges, different companies.

The idea that there are strong connections between them as a result of the program, and that they can form a little support network, that’s a pretty powerful concept.

KM: And what can companies like Google do to help build those relationships?

MM: I think the biggest thing that companies like Google can do, other than being increasingly transparent about statistics, is give money, encourage folks to volunteer, and give time.

My management is very supportive of the time that I might give to All Star Code. And there are many people like that around the office. Like, I would consider myself to be middling on the spectrum of the level of passion and commitment and time commitment to other organizations.

There are many people at Google — of all races, gender, background — who are really interested in contributing their time and working with the different groups. So that’s probably one of the most powerful things that Google and other companies can do — be encouraging of your employee base to follow their own instincts and passions in helping in these areas.

KM: If you could give one piece of advice to some of those students at All Star Code, and I’m sure you actually do this anyway, what do you tell them?

MM: I tell them, “Always try to do the hardest thing that you can find.” It’s stolen from something that Marissa Mayer, who used to be at Google and is now at Yahoo, has talked about.

If you ever have a choice between two paths, then you want to think about the one that’s harder — the one that represents a little more risk, a little more potential learning opportunity.

When you are in high school, or in college, the decisions that you make can seem really monumental. Like, you know, this summer internship, this is a huge decision in my life. What am I going to do? Or this first job. But, when you look back on that, you realize that, those are the times that you can take more risk.

And so what I really encourage the students to do is, don’t be afraid of taking a hard path or a risky path, because those pathways provide the greatest learning opportunities and, I think, the best foundation for great success.