Théo Négri, a young software engineer from France, had come up with so many novel ideas at his job at an Internet start-up in San Francisco that the American entrepreneur who hired him wanted to keep him on.

So he helped Mr. Négri apply for a three-year work visa for foreign professionals with college degrees and specialized skills, mainly in technology and science. With his master’s degree from a French university and advanced computer abilities, Mr. Négri seemed to fill the bill.

But his application for the H-1B visa was denied, and he had to leave the United States. Back in France, Mr. Négri used his data skills to figure out why.

The answer was simple: Many of the visas are given out through a lottery, and a small number of giant global outsourcing companies had flooded the system with applications, significantly increasing their chances of success. While he had one application in last year’s lottery and lost, one of the outsourcing companies applied for at least 14,000. The companies were squeezing out American employers like his boss.