In the Olympics of Algorithms, a Russian Keeps Winning Gold
Google’s Petr Mitrichev is the all-time champion of competitive programming, a little-known sport where tech giants scout for talent.
If Vladimir Putin glances out the windows of the Kremlin at just the right moment, he has a chance of glimpsing the world’s best computer programmer in Google’s Moscow office across the river.
He is Petr Mitrichev, a 27-year-old Russian who works on Google’s search engine and earned his champion’s title in competitive programming, a sport where hackers write computer code in pursuit of cash prizes, travel opportunities, and a deep fulfillment unattainable anywhere else.
“You have a feeling of satisfaction in a contest when you solve a problem,” says Mitrichev, affable and a little pale in a Google T-shirt during an interview on the lawn of the company’s headquarters in Mountain View, California.
Since 2005, Mitrichev, a graduate of Moscow State University, has led the globe in algorithmic programming. That’s the Grand Prix of competitive coding categories, in which riddles involving infinite game boards or the decibel level of n + 1 mooing cows require instant mathematical insights and quick fingers on the keyboard. Mitrichev is known for his “short pause”—that is, he starts to answer questions nearly as soon as he sees them.
To Mitrichev, competitive programming offers a rare island of absolutes in a subjective world. “The beautiful aspect is that it’s totally automatic and there is no human judgment involved at all,” he says. “It’s one of the fairest competitions I’ve ever seen.”
Not only algorithm crafters such as Mitrichev see beauty in that. Technology companies use the sport programming scene as a place to discover the world’s smartest—and fastest—coders. Giants such as Facebook and Google sponsor the top competitions, plastering their logos around event halls like Rolex at Wimbledon (see “Letting Hackers Compete, Facebook Eyes New Talent”).
Mitrichev’s rise began when he was 10, after he picked up a book belonging to his older brother about the computer language Pascal. Although there was no computer in his Moscow home, the next year he placed 60th out of 100 in Russia’s national programming competition for high-school students. Since he was only 11, the judges awarded the youngster a computer. At 15, he won the competition outright. Soon after, he was on the international circuit, making his debut at the International Olympiad in Informatics in Beijing.
Mitrichev earned his current world ranking only after joining the premier leagues of competitive programming, a series of weekly and annual contests run by the Connecticut company TopCoder that attract more than 400,000 programmers from around the world. Switching programming languages from Pascal to C#, he surged up the rankings to take over first place in 2005, a position he still holds today.
Such mastery and a sporting demeanor have made Mitrichev a geek hero. Forum posts dissect his every performance, which he posts as videos online. At the larger, annual contest that convenes hundreds of coders in a hotel ballroom, large screens relay live feeds from the competitors’ monitors. Chairs are drawn up 20 minutes early for a good view of Mitrichev at work.
“Murmurs go through the crowd when they see that he has a bug, and again when they see that he’s fixed it,” says Mike Lydon, TopCoder’s CTO. “To the layperson there’s nothing to see. But to these guys this is fascinating.”
The problems in these competitions often outline physical situations that must be described mathematically. Doing that requires writing an algorithm—a sequence of operations to be performed on data. One of the problems in Mitrichev’s most recent competition, on July 21, was to predict the position of pieces in a checkers game played on an infinite board. Competitors win points when their programs correctly handle test data. Some contests include a challenge phase, where the goal is to submit data that trips a competitor’s program.
There is significant money at stake in the sport. Top prizes can be worth $25,000 (Mitrichev has won several), and because algorithms drive lucrative businesses in Silicon Valley and on Wall Street, many top coders are recruited into high-paying jobs. (A Google PR representative would not let Mitrichev discuss his compensation.)
Mitrichev is unusual because he has continued to compete—and to win—even after getting such a job: he started work at Google in 2007. He says he keeps competing because writing code is relaxing. TopCoder’s weekly online competitions take roughly 90 minutes. “You can watch a TV show or you could enter,” he says.
Even at leisure, Mitrichev is a force to be reckoned with. In 2011 he won Facebook’s first programming contest, the now annual Hacker Cup. He showed up for the final at Facebook’s headquarters and collected his trophy with his Google employee badge attached to his jeans. Some saw it as a brazen taunt in the companies’ rivalry for hacker supremacy. “I just had left it on from the day before,” says Mitrichev. “I was not trying to make any point.”
Mitrichev’s job at Google is to improve its search tool, built from perhaps the most finely tuned and valuable algorithms in history, which registers nearly five billion requests a day. That’s difficult, he says, because most of the easy techniques have already been implemented, including in PageRank, the iconic algorithm originally written by Google’s founders. Improving search results now involves more subtle tweaks, such as finding synonyms or other language tricks to help extract extra meaning from a user’s search terms.
“When you have an idea, then you implement it as an algorithm, and then you run an experiment,” he explains. If search rankings come out better—if people click the top results more often in live tests—the new algorithm stays.
Next time a Google search returns exactly the result you wanted, you can judge for yourself.