Original URL: https://www.theregister.com/2011/03/12/facebook_hacker_cup_kicks_off/

Ruskie Java coder lifts inaugural Facebook Hacker Cup

C++ men squashed

By Cade Metz

Posted in Software, 12th March 2011 21:52 GMT

The sliding glass doors at the entrance of Facebook headquarters don't say Facebook. They say HACK – in big, bold, black letters, two on each door. The company goes out of its way to cultivate an extreme developer culture built around the non-pejorative definition of the word. "There's this whole definition that engineers have for themselves," Mark Zuckerberg recently told an incredulous middle-aged American newswoman. "It's very much a compliment when you call someone a hacker. To hack something means to build something very quickly. In one night, you can sit down and you can churn out a lot of code, and at the end, you have a product."

Hacker Cup

The Hacker Cup cup

These all-night hackathons are a regular part of life inside the social networking behemoth, as millions of mainstream movie goers are very much aware. And now, following the lead of Google and so many others, Facebook has turned the idea into an official coder v coder competition, complete with an unwieldy trophy and some cash prizes.

The first annual Facebook Hacker Cup began in January as an online competition, with nearly 12,000 developers from across the globe joining the fray. After three elimination rounds, the 12,000 were whittled down to twenty-five, and on Saturday morning – at the very un-developer-friendly hour of 9am – these coders descended on Facebook headquarters in Palo Alto for the final geekoff. The twenty-five finalists included seven developers from Poland, six from Russia, four from the US, and exactly zero from the United Kingdom.

These alpha programmers weren't competing to build applications. This isn't a contest that relies on judges. It's not like Rails Rumble or Node Knockout or synchronized swimming. It's like Google Code Jam. Or TopCoder. Contestants were asked to solve algorithmic problems. "It's almost more of a math contest than a programming contest," said Facebook engineer David Alves, who helped organize the competition and write the problem sets. In the end, there are only right answers and wrong answers.

The finalists were given two hours to solve these three problems:

Contestants could use any language and any tool to build a program capable of solving these problems. And once they actually downloaded the input data and plugged it into their code, they had six minutes to produce an answer. Naturally, the coder with the most correct answers wins, with ties decided by how quickly each contestant delivered each solution.

Most contestants coded in C++, as you might expect, given the tight time frame. And all twenty-five coded atop, um, Windows machines. Facebook offered a choice of Windows or Mac, and according to Alves, no one wanted a Mac. "I can't really explain it," he said. "It surprised me." Several developers told us they merely chose a Windows machine so they could put Linux on it. But some were happy with unadulterated Windows. Chinese developer Tiancheng Lou coded on Windows with Visual Basic, and Russian Petr Mitrichev, opting for Java, ran IntelliJ IDEA on the Microsoft OS.

"[IntelliJ] runs the same on all platforms," he told us, "so I don't care what OS I use."

After two hours, only three coders produced answers to all three problems, including Tiancheng Lou and Petr Mitrichev; four finished two; and ten finished one.

Hacker Cup wide shot

But not all solutions were correct. Lou's answer to "Safest Place" missed the mark, and he dropped to third place, handing the trophy – and $5,000 – to Mitrichev. Asked why he coded in Java when most contestants used C++, Mitrichev told us: "It's harder to make a mistake in Java." Asked how many of these of hackathons he's competed in, he said: "Thousands." In 2006, he won the Google Code Jam.

Hacker Cup winner Petr Mitrichev

Petr Mitrichev

You can find Mitrichev's solutions to the three problems here (registration required).®