avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • December 10, 2018, 01:38 PM
  • Proudly celebrating 13 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Facebook Programming Puzzles (Solve and Get Hired)  (Read 4221 times)


  • Animated Giffer in Chief
  • Honorary Member
  • Joined in 2010
  • **
  • Posts: 3,491
    • View Profile
    • Donate to Member
Facebook Programming Puzzles (Solve and Get Hired)
« on: November 12, 2010, 04:53 PM »
Just found this while bumbling aimlessly around facebook which people might find interesting:




If you love puzzles like we do, become a fan of the new Puzzle Master Facebook Page. Notes are regularly posted to answer questions, explain puzzles, and announce new things. While you're here, try your hand at the following puzzles. The larger the difficulty, the harder it gets (hors d'oeuvres are simple tests to help you out).

Submission directions:

All submissions must execute in a *NIX type environment (sorry, no Windows specific solutions are accepted). You are not guaranteed any libraries or plugins beyond what is part of the language/interpreter itself. The following languages are accepted:
GNU C/C++ 4.2.3
Ericsson Erlang 5.5.5
GHC Haskell 6.8.2
Sun Java 1.5.0_15
INRIA OCaml 3.10.0
Perl 5.8.8
PHP 5.2.4
Python 2.5.2
Ruby 1.8.6
Some puzzles may require being solved with the following libraries:
Thrift r760184 (Download Link - Redirected To Server Via Facebook)


How To Submit:

Follow all of the following directions or your submission may be considered incorrect.
Submissions should be sent via email to the address: {0xFACEB00C>>2 in decimal}
The subject line of the email must exactly match the puzzle keyword. Failure to do so means your submission will not be evaluated. Submissions are evaluated and the results emailed back every four hours.
If you have a Facebook account, send your submission from the same email address you login to Facebook, or we may not be able to find you!
The actual text body of the email will be ignored for grading purposes. Make sure all solution materials are attachments (see below).
Your solution must build or supply an executable file/script whose name is exactly the same as the puzzle keyword (case-sensitive). You do not have to worry about file permissions for the main executable, they will be checked and/or set for you.
You may compress/archive your solution files with tar or zip. The file extensions of these archives must be .zip, .tar, .tar.gz, .tgz, or .tar.bz2. If you compress your solution, only submit one compressed file.
If you compressed your solution, any Makefile/build.xml files (and the executable file itself) need to be uncompressed and/or built into the same root directory as the compressed archive itself or your submission will result in a build error.
If your solutions uses one of the compiled languages, it must be buildable using either GNU Make 3.81 or Ant 1.7.0 using the commands make or ant from the root directory where your submission is stored. You must supply your own makefiles or build.xml files.
You may assume the compilers are within the execution environment's path. The interpreted scripting languages have been installed in both /usr/bin and /usr/local/bin (the only exceptions are /bin/bash and /bin/sh)
If you make a mistake in your submission, you may send another email. Prior incorrect or malformed submissions will not be counted against you.
For extra credit, you may submit additional solutions in different languages. Submit each solution as a separate email. Every solution must be implemented in a language from the provided list.



Please Note: I have no affiliation with Facebook and receive nothing for bringing you this information.
« Last Edit: November 12, 2010, 04:56 PM by Stephen66515 »


  • Supporting Member
  • Joined in 2010
  • **
  • Posts: 4
    • View Profile
    • Donate to Member
Re: Facebook Programming Puzzles (Solve and Get Hired)
« Reply #1 on: November 16, 2010, 07:57 PM »
Intriguing. I'll have to give the puzzles a try! Can't wait to be shown how little I actually know.  :P


  • Animated Giffer in Chief
  • Honorary Member
  • Joined in 2010
  • **
  • Posts: 3,491
    • View Profile
    • Donate to Member
Re: Facebook Programming Puzzles (Solve and Get Hired)
« Reply #2 on: December 10, 2010, 09:31 AM »
Glad to help  :Thmbsup:


  • Participant
  • Joined in 2010
  • *
  • default avatar
  • Posts: 1
    • View Profile
    • Donate to Member
Re: Facebook Programming Puzzles (Solve and Get Hired)
« Reply #3 on: December 12, 2010, 05:11 PM »
A coworker mentioned these puzzles to me last week, I took on 'liarliar' in C++, spent half an hour coming up with a sub-50-line program that solved it (conciseness was my goal), submitted it, got back a response that it passed all their tests, taking 1610.652ms on the longest test case.

I then tried to see how well that time compared to other solutions.  There is a discussion about just that here:


and seeing some impressive times for 'liarliar' there I set out to code a more optimized solution (in C this time).  After a few hours of work, spread out over a few evenings, I got one I was satisfied with, it ran nearly 15X faster than my C++ version on some very large programmatically-generated test cases.  Submitted that last night and got back this morning that it passed all their tests and took 423.313ms on the longest test case.  Not the 15X I was hoping for but I'll take it . . . but it leaves me wondering how the times claimed to be around 110ms were achieved.

Anybody else have any times to share?