But Code.org’s multilevel influence machine also raises the question of whether Silicon Valley is swaying public schools to serve its own interests — in this case, its need for software engineers — with little scrutiny. “If I were a state legislator, I would certainly be wondering about motives,” said Sarah Reckhow, an assistant professor of political science at Michigan State University. “You want to see public investment in a skill set that is the skill set you need for your business?”

Mr. Partovi, 44, said he simply wanted to give students the opportunity to develop the same skills that helped him and his backers succeed. He immigrated as a child to the United States from Iran with his family, went on to study computer science at Harvard, and later sold a voice-recognition start-up he had co-founded to Microsoft for a reported $800 million.

“That dream is much less accessible if you are in one of America’s schools where they don’t even tell you you could go into that field,” Mr. Partovi said.

Even so, he acknowledged some industry self-interest. “If you are running a tech company,” he said, “it’s extremely hard to hire and retain engineers.”

Code.org is now one of the largest providers of free online coding lessons and more comprehensive computer science curriculums. It has also provided training workshops to more than 57,000 teachers, Mr. Partovi said.

The rise of Code.org coincides with a larger tech-industry push to remake American primary and secondary schools with computers and learning apps, a market estimated to reach $21 billion by 2020.