Facebook Cup 2015 Underway Solutions Available
Written by Sue Gee   
Saturday, 17 January 2015

Over two thirds of the those who participated in the qualification round for this year's Facebook Hacker Cup and  of them are through to Round 1 of the contest which starts today at 10:00 PST and lasts 24 hours.

Entering the HackerCup is worthwhile not because of the cash prizes and the t-shirts but because it is one of the few high profile competitions that is actually about an ability to create and implement algorithms. In this sense it can be considered the programmer's competition.




Now that the qualification round is over, the questions, the solutions and the scoreboard are available on the competition's Facebook site.

As usual there were three problems of graduated difficulty and 9,276 people downloaded at least one problem during the qualification round and 6581 of them answered at least one of the problems correctly - which was sufficient to get them through to the elimination rounds in which the questions get tougher and tougher and fewer and fewer contestants get to progress on: 

  • Round 1 January 17 10:00 PST (18:00 GMT) lasts 24 hours
    The top 500 finishers will advance to Round 2. Everyone that gets the same number of points as the person in 500th place will also advance to Round 2.

  • Round 2 January 24 13:00 PST (21:00 GMT) lasts 3 hours
    The top 100 finishers will advance to Round 3.
    The top 500 finishers will receive t-shirts

  • Round 3: January 31 13:00 PST (21:00 GMT) lasts 3 hours
    The top 25 finishers will be flown on an expenses paid trip for the onsite final at Facebook HQ in California on March 5-6.

The scoreboard suggests that competition in today's round will be pretty fierce. One in ten of the participants (928) in the qualification round had perfect scores of 100 by submitting the correct solutions to all three of the problems, another 370 scored 85 points by solving the two harder ones and 38 people qualified answering just the hardest one.

So what were the problems:

Cooking the Books - 15 points
Given a number up to 9 digits long, how small or large can it be made by swapping two of its digits?

New Year's Resolution - 30 points
Given a set of up to 20 pieces of food, each of which has some fixed mass of protein, carbohydrates and fat you have to to select a subset such that the sum of the protein, carbs and fat in the selection matches a given goal.

Laser Maze - 55 points
This is a classical path-finding problem with a twist.  Find the shortest path between two points in a maze which is infested with laser turrets that will zap us if  you stand in their line of fire.

As well as the information provided on the Facebook site, which discusses the algorithm required there is also an analysis by Soultaker on Tweakblogs giving us all a chance to look at code (in Python, C and C++) that produces the right solutions.

If you are wondering how much harder Round 1 problems will be, see Soultaker's analysis of the 2013 problems - again there is code and there are also comments  some of which provide alternative approaches.

This is certainly a contest that makes you hone your programming skills.



More Information

To be informed about new articles on I Programmer, install the I Programmer Toolbar, subscribe to the RSS feed, follow us on, Twitter, FacebookGoogle+ or Linkedin,  or sign up for our weekly newsletter.



At What Age Do Programmers Write Languages?

This is just one of many question that can be answered by reference to PLDB, the programming language database devised and maintained by Breck Yunits, himself the author of Scroll, an o [ ... ]

TIOBE Index June Highlights

The June 2024 TIOBE Index is out and its headline comes as a bit of a shock: C++ surpasses C for the first time in history. Lower down the ranks both Go and Rust have achieved their highest positions  [ ... ]

More News



Last Updated ( Saturday, 17 January 2015 )