There are likely to be 150,000 computing jobs opening up each year through 2020, according to an analysis of federal forecasts by the Association for Computing Machinery, a professional society for computing researchers. But despite the hoopla around start-up celebrities like Mark Zuckerberg of Facebook, fewer than 40,000 American students received bachelor’s degrees in computer science during 2010, the National Center for Education Statistics estimates. And the wider job market remains weak.

“People can’t get jobs, and we have jobs that can’t be filled,” Brad Smith, Microsoft’s general counsel who oversees its philanthropic efforts, said in a recent interview.

Big technology companies have complained for years about a dearth of technical talent, a problem they have tried to solve by lobbying for looser immigration rules to accommodate more foreign engineers and sponsoring tech competitions to encourage student interest in the industry. Google, for one, holds a programming summer camp for incoming ninth graders and underwrites an effort called CS4HS, in which high school teachers sharpen their computer science skills in workshops at local universities.

But Microsoft is sending its employees to the front lines, encouraging them to commit to teaching a high school computer science class for a full school year. Its engineers, who earn a small stipend for their classroom time, are in at least two hourlong classes a week and sometimes as many as five. Schools arrange the classes for first thing in the day to avoid interfering with the schedules of the engineers, who often do not arrive at Microsoft until the late morning.

The program started as a grass-roots effort by Kevin Wang, a Microsoft engineer with a master’s degree in education from Harvard.