Shoeb Mogal, 30, got addicted to computers when he was a kid back in India.

"I always liked the idea of developing games, I like developing websites," he said.

So a few years ago he came to Boston to study computer science at Northeastern University. When he graduated, his skills were in demand.

"At a point, in a week, I was giving like 20 interviews," he said.

Within two weeks, Mogal had three job offers. He now works as a software engineer for EverQuote in Kendall Square making over six figures.

Shoeb Mogal, 30, began working on H1-B visa for a tech company in Kendall Square after graduating from Northeastern. (Asma Khalid/WBUR)

Mogal said local tech firms are struggling to find talent. And so they hire foreigners like him and try to get them an H-1B visa. These are the visas that allow companies to hire high-skilled tech workers from abroad.

It's a popular program in the high-tech community. Last year, there were more than a quarter of a million applications. For years, the tech community has been lobbying Congress to increase the number of annual visas, which are capped at 85,000.

But expanding the program seems unlikely at this political moment.

During the presidential campaign, Donald Trump criticized the H-1B program for taking jobs away from qualified Americans. Last month a draft executive order from the Trump administration began circling online. There are also three different pieces of legislation that have already been introduced in Congress — all with the goal of overhauling the H-1B program.

The crux of the H-1B debate is this: On one side tech companies insist there's a shortage of talent, but on the other side, some Americans insist H-1B workers are taking away their jobs.

Can both of these arguments be true at the same time?

It's a complicated argument that differs depending on where you live.

In Cambridge, Mogal said there aren't enough American engineers and computer programmers. And his own experience is proof. He added he can easily think of more than 100 friends on H-1B visas hired by local companies.

Mogal said employers are not hiring foreigners because it's a financially smart decision; hiring an H-1B worker over an American can be pricey. Companies have to pay lawyer fees, and, in some cases, H-1B transfer fees.

"If I was running a business, I wouldn't hire myself in theory," Mogal said with a laugh.

"Companies do not do that because they like paying that much more. It’s just because of the scarcity of developers that we have here," Mogal said.

Tech CEOs Say Visa Program Brings Talent

In Massachusetts, MathWorks, a computing software company in Natick, is near the top of the list when it comes to companies pursuing H-1B workers, according to publicly available data from the Labor Department.

"There’s always been a shortage in the full history of the company’s existence. It’s always been hard to find talented programmers," said Jack Little, co-founder and president of MathWorks. (Full disclosure: MathWorks is a WBUR underwriter.)

The unemployment rate in Massachusetts is 2.8 percent. And so Little said it's a particularly competitive market.

"Very often, people get four, five offers," he said. "They'll have offers from California, they’ll have offers from all over the country."

Little said MathWorks uses the H-1B visa program mostly for hiring students with masters and Ph.D.s out of American universities.

But each year, only a finite number of visas (again, 85,000 nationally) are issued — and the selection system is a lottery.

"We’ve had to send people back to their countries, because they didn’t get picked," said Little. "It’s just crazy to have to send people back, somebody that’s worked at your company for several years. They’re trained, they’re up to speed. They’re delivering things, and they can’t get permission to stay in the U.S."

Visa-Holders May Cut Costs, But Workers Are Cut Loose

But, nationally, some of the biggest beneficiaries of H-1B visas are not high-tech firms. They're outsourcing companies, like Infosys and Tata Consulting, who essentially hire entry-level IT workers, and import them from India to do the jobs Americans are already doing.

Craig Diangelo from New Britain, Connecticut, worked for Northeast Utilities, now known as Eversource, for 11 years.

Diangelo is a straight-talker, a slim guy with a full head of white hair. He used to make $130,000 a year (with his bonus) working in the IT department.

But in June 2014, he was let go and replaced by someone from Infosys. Infosys declined to comment for this story.

Craig Diangelo inside his home in New Britain, Conn. He used to work in IT for Northeast Utilities (now Eversource) before he was replaced by an employee on an H1-B visa from the outsourcing firm Infosys. (Asma Khalid/WBUR)

Diangelo said he had never heard of the H-1B program, but one of his higher-ups told him "global workers can adjust to change a lot faster than the American worker can."

Via email, a spokesman for Eversource described the Infosys relationship as a reorganization decision following its merger with NSTAR: "Our transition to a new model for Information Technology services was one of many important steps in transforming our companies following our merger into one that would deliver superior service, value and savings for our customers."

Diangelo said he had to train his replacement or risk losing his severance.

"The individual that came over from India, he started what they call 'shadowing.' So he would shadow me for the day, and I would show him what I was doing," said Diangelo. "He sat next to me the whole time. He had a chair in my cubicle."

In total, nearly 200 IT workers at Northern Utilities were affected and either lost their jobs or took early retirement. Diangelo eventually found a new IT gig making less money, but he considers himself lucky.