1 Mar 2011

Hyperpublic Developer Challenge Stats and Recap

Last Thursday over at Hyperpublic we launched The Hyperpublic Developer Challenge. It consisted of two programming problems, one of easy/medium difficulty, and one which was slightly harder. We built it for fun, because we're developers, and we love when there's a fun problem around to work on if we get bored or need a distraction. The response to the challenge was phenomenal. We had thousands of developers from around the world working on the problems, and hundreds submit correct solutions. Here's a summary of the response, the problems, the winners, and some observations.

The Response
Screen_shot_2011-03-01_at_9
To our amazement, 5,759 people landed on our challenge start page. From there 2/3rds of them, or 3,856, were feeling brave enough to at least look at the first problem. I'm sure it didn't hurt that we were giving away free Dropbox and Github accounts, so even the non-programmers who landed on the page at least wanted to take a look at the first problem. The response peaked out with 400+ people viewing/working on the challenge concurrently.

The first problem, summarized below, proved to be a strong filter. Only 446 people, or 11.57% of people who looked at the problem, submitted a correct response. 4,860 incorrect answers were submitted, meaning that the successful submission rate was under 10%.

Problem 2, the more challenging problem, received 231 correct submissions. This means that of the 446 people who made it through question 1, only 51.79% of people made it through problem 2. There were 753 incorrect submission attempts.

All in all, 4.01% of people who viewed the challenge made it through to completing both problems.
Screen_shot_2011-03-01_at_9

The Problems
Problem 1 asked developers to calculate the influence of fictitious users in Hyperpublic based upon the influence of the users which they have added to the system. The data was given as a text file, but it could easily be converted into a 2-D array representing which users added which other users to the system.

The most common approach was to use the input as a matrix representation of a directed graph. For each user in the input, traverse the graph recursively to sum up the number of users that the initial user was responsible for. Then find the three users with the highest scores, and use them to compute your answer to problem 1.

While we won't be posting code examples here because we'll leave the contest up for others to try, there are various solutions available around the internet and github, which can be found quite easily be googling/searching github.

Problem 2 assigned point values to various tasks around Hyperpublic and gave 4 users point totals. It asked the developer to compute the minimum number of tasks required in order to reach their exact point totals. This proved a bit trickier, in that many people's first instinct was the use a greedy algorithm in which they always executed the task with the largest point total before moving on to tasks with smaller point totals. This would lead to an incorrect submission and developers to rethink their solutions.

The best way to write this program for inputs and point values of any size is using dynamic programming. This is analogous to the optimal solution coin changing problem which asks what the optimal way to make change for a given amount of money is using coins of various values. It uses a technique called memoization, where you compute the optimal ways to make change for values 1, 2, 3...up to your highest amount, and you use the previously computed values to compute the next unknown values in k attempts, where k is the number of distinct values of coins.

The other way common way in which people solved this problem efficiently was by solving 4 different linear equations. There were some one line solutions using Mathematica and Matlab linear solvers. 

Fortunately, the problem size was limited enough in that a brute force solution would run quite quickly if people really got stuck as well.

The Winners
From the 231 correct submissions, we randomly selected winners of the following prizes:

Github "Medium" account free for one year - Norbert Fekete. Norbert hails from Mosonmagyarovar, Hungary, and submitted his solutions in C++. He's new to github, so follow him over there and suggest some repos for him to fork.

Dropbox "Pro 100" account free for one year  - Brian Barthel. Brian is from Memphis, Tennessee, submitted a C# solution, and runs an independent software company called Zoasoft

Free desk for a month for two hackers to work on their own project at Hyperpublic HQ - Martin Czygan. Martin is from Leipzig, Germany, submitted a python solution, and since he can't take advantage of a free desk in NYC anytime soon he has graciously donated the prize to an NYC based hacker who can use it. You can find him on github and twitter.

Other Observations
The most common language that we saw in submissions was Python. We haven't run exact numbers, but eyeballing it, Ruby, PHP, Java, and C++ were the next most common. There were submissions in a wide range of languages though including Groovy, Scala, Clojure, L, Ocaml, C, Javascript, Haskell, Matlab, Mathematica, and others. Haskell in particular was popular among people who self identified as students or researchers.

Many people who submitted commented that the problems were too easy, and they would have preferred a harder challenge. We think that judging by the number of people who made it through, the number of people who emailed for help, and the number of people who submitted incorrectly, that the difficulty was about right. The majority of responses were very positive in that they said "this was a fun way to kill an hour or two." We wanted the problems to take only an hour or two, and as such I think we got the difficulty right. People got to brush up on their dynamic programming or linear solving, they got to construct a graph, or they got to get their hands dirty with a new language. We think people had fun.

The last thought, is that we did this for fun, and we're glad people enjoyed it. We also wanted to meet more developers and make them aware of Hyperpublic. We're working on structuring data around every "local object" in the world, which is a big technical problem. If you're interested in working on this with us, or hearing more about it. Don't hesitate to contact me.

Looking forward to the next programming challenge.

 

10 Mar 2010

Thank You Heroku, or "How To Eliminate Sysadminning"

Picture_3

I need to take a couple minutes here to do something I've been meaning to for along time: Thank Heroku for being so baller.

For those of you not in the know, Heroku is an all-in-one Ruby platform built on top of Amazon web services. If you're a Ruby developer, and you are creating a web application, I highly recommend checking it out.

I've been using Heroku on two applications, including JumpPost, which officially launched today via a nice writeup on the Thrillist NYC site and newsletter. I'd like to share a couple reasons why I love the Heroku platform and would advise any agile startup to consider using it to get their product launched quickly.

Heroku is fast
The same could be said for any well configured EC2 instance, but don't underestimate the words well configured. The smart folks at Heroku have fine tuned every layer of the stack from using the fastest web servers (nginx), caches (Varnish, Memcache), and load balancing strategies.

Heroku is scalable
At the core of Heroku's architecture is a pre-compiled version of your application called a "slug" which is ready to be deployed in seconds to as many instances as you desire. Expecting a big press hit, or noticing your request queue filling up, just type a simple command and add more resources in seconds. Your users won't even know.

Heroku is easy
To deploy you literally type one command at the command line. They provide add-ons for caching, email, DNS, performance monitoring, custom domains, etc...many of them free. 

Heroku provides killer support
Not only does the staff respond to tickets and support requests within minutes, but they go overboard to support the latest and greatest Ruby features. They're very active on the newsgroup, and they even provide sample code for how to best utilize their architecture. 

Heroku is cost-effective
People may argue me on this one, because at face value the cost is actually rather expensive (think 2x the regular price of AWS). But these people aren't taking into account the cost of their own time when it comes to sysadminning, troubleshooting, not the mention the cost of downtime. Heroku never goes down, and it eliminates the need to pay a sysadmin (or the time value of sysadminning yourself).

Heroku is beautiful
Don't believe me? Check out their pricing page (yes they know their demographic are samurai loving programmers). Navigating their site to manage add-ons, monitor performance, and scale up and down resources is a pleasure.

With all of the above, there are a couple downsides that people should be aware of. Proper SSL is expensive, and should your app face custom scaling needs or challenges then you are locked into their stack. Fortunately their stack is designed for large scale use. The Heroku folks are well aware of these concerns, and they're very open about what they're doing to improve the experience for all of their customers. For startups getting their product off the ground, the time savings early on far outweigh the cost of figuring out a custom solution later should your product achieve grand scale. In case you couldn't tell, I'm a big fan.

If you have any questions about the platform, don't hesitate to email me at petkanics@gmail.com.

Doug Petkanics's Space

Co-Founder of Hyperpublic. Fighting the good fight.