Over the weekend, 24 of the world’s top programmers from 10 different countries came together at Facebook HQ to compete in the third-annual Facebook Hacker Cup Finals.

The competition started with over 12,000 people from 126 countries around the world competing to solve algorithmic coding challenges in three online elimination rounds. Twenty-six earned their spots in the finals and were flown to Facebook’s HQ in Menlo Park, Calif. for the competition.

The top finalists represented Australia, Belarus, China, France, Germany, Japan, Poland, Russia, Switzerland, and Ukraine. After arriving in California, the finalists spent two days hanging out at Facebook HQ, talking with engineers and eng leadership at tech talks, bowling at Lucky Strike, and of course, battling it out for the winning title.

The finalists spent Saturday competing for the top prize of \$10,000 and Hacker Cup Champion title. Each contestant submitted their code as they completed the problems, and after two hours of hacking, the answers were graded and evaluated alongside each person’s total coding time.

And the winners of the 2013 Facebook Hacker Cup are:

1st place: Petr Mitrichev, Russia (2011 champion)

2nd place: Jakub Pachocki, Poland

3rd place: Marcin Smulewicz, Poland

Congratulations to all of our finalists! To see an example of the kind of problems they tackled and to prepare for next year, check out the problem below:

Do you know Minesweeper, the famous video game? The player is initially presented with a grid of undifferentiated squares. Some randomly selected squares, unknown to the player, are designated to contain mines. One square can contain at most one mine.

The game is played by revealing squares of the grid, typically by clicking them. After that, a digit is revealed in the square, indicating the number of adjacent squares (under 8-way connectivity, that is, if two squares share either an edge or a corner, they are considered adjacent) that contain mines. If this number is zero then the surrounding squares are automatically also revealed. This process applies recursively and automatically every time a new square with count zero is revealed.

Now, given a Minesweeper situation, you need to check if it is possible that such a situation can occur after exactly 1 click on the grid. Note that the game is designed in such a way, that the first clicked square never contains a mine.

To help personalize content, tailor and measure ads, and provide a safer experience, we use cookies. By clicking or navigating the site, you agree to allow our collection of information on and off Facebook through cookies. Learn more, including about available controls: Cookies Policy