(Damian Dovarganes/AP)

The United States took home the most number of medals at this year's Summer Olympics in Rio. But what if coding was one of the competitive events? A new HackerRank study reveals that the United States wouldn't stack up quite so well against international competition.

The study compiled the results of 1.4 million coding challenges by about 300,000 developers completed on the website HackerRank, a free coding practice website that doubles as a developer recruiting ground for companies such as Facebook and Airbnb. After breaking down the results by country, HackerRank found that U.S. coders landed in 28th place.

"I don't think it's that surprising," said Vivek Ravisankar, co-founder and chief executive of HackerRank. "In my opinion, the U.S.’s position here mirrors a lot of the other world ranking reports, such as STEM education performance or even other international coding competitions," he said.

HackerRank found that the most talented coders were based in China, followed closely by Russia. Rounding out the top five were Poland, Switzerland and Hungary. The three poorest performing countries were Pakistan, Sri Lanka and Nigeria.

Screen Shot 2016-08-29 at 9.04.16 PM

The data was also spliced by type of challenge, breaking down into puzzle categories such as algorithms, data structures and artificial intelligence. Algorithms, which was the top challenge choice for coders, was dominated by Russians, while the Chinese performed best at data structures.

The study falls in line with other rankings that capture the skill sets of coders by country. Last year's Pew Research Center analysis of STEM test scores revealed that American students fell in the middle of the pack, underperforming compared to students in Singapore and South Korea. At this year's International Olympiad in Informatics, a UN-sponsored competition of computing skills, the list of winners told the same story. Chinese, Russian and Eastern European contestants dominated, while the highest scoring American coder came in 15th place.

Russian and Chinese coders continue to triumph at the ACM International Collegiate Programming Contest, where St. Petersburg University beat out Harvard University this year. Then there's Google Code Jam, where participants compete to solve algorithmic puzzles — China and Russia are neck and neck with first-place prizes, save for three back-to-back wins by a top coder from Belarus named Gennady Korotkevich.

Part of these countries' success with producing top-quality coders might have to do with starting math- and computer-focused education at an early age. In China, preschool coding classes have become increasingly popular for parents of young children. In Russia, math circle culture that dates back to the Soviet era introduces problem solving and math "olympiad" competitions to students as young as middle school.

Ravisankar, who has spoken with top performing coders on HackerRank about where they learned their skills, agrees that this is the most commonly cited answer for coding excellence. "There's more of a culture of coding and practicing math-related subjects at a much, much earlier age in these countries," said Ravisankar.

"It's just a part of early education over there," he added.