How a community-building side-project organized by Google France engineers became a global programming competition
Once a year, there comes a day in February when 100 000+ developers get ready to
work on a single programming challenge.
The participants gather in small teams of 2-4 people. They are all over the
world, from Cape Town to Oslo and from San Francisco to Tokyo. Some participate
independently, others represent their local university or a developer group.
Over the course of just four hours, they will all be solving a single open-ended
problem, fuelled by curiosity and (often) pizza. When the time is up, no one
should feel discouraged if they didn’t find the definite best solution – because
it usually doesn’t exist. Welcome to Hash Code, an
annual team programming competition organized by Google!
I’ve been part of the volunteer engineering team at Google that created the
competition back in 2013/2014, and then scaled it to the global event that it is
today. As Hash Code is fast approaching its 10th anniversary, I thought it’s a
good occasion to reflect on what we’ve learned so far and share a few fun
stories from behind-the-scenes.
Hey Google, how to build a community?
Back in 2013, the engineering team at Google Paris was new, relatively small and
growing fast. As a new kid in town, we felt we could benefit from more outreach
– including building more connections with French students and universities. And
what do you do when you want to build connections with someone? Obviously, you
invite them over for a pizza-and-coding session!
But what should the coding session be about?
In a brainstorming session, we agreed on three pillars that remarkably still
guide Hash Code 10 years later:
create a fun, welcoming environment – to make the event interesting, we
decided to make it a competition. But we also wanted to make sure it works for
participants at all skill levels ➡️ this is why Hash Code problems are
open-ended: to make it easy to develop a naive solution first, and iterate
offer a reasonably realistic view into how engineering teams work ➡️
This is why Hash Code is a team competition of 2-4 people per team
focus our time and energy on the essentials – because it started as a side
project for a few engineers with full-time commitments elsewhere, we couldn’t
plan to build anything too fancy (like a real-time battle of AI bots) ➡️ This
is why in Hash Code you only need to upload the resulting output of your
program (while the program itself runs on your computer) – we chose to focus
more time on developing the competition problem and less time on the
That sounds great in principle but then again, what should the competition be
For this, we didn’t look far for inspiration – at the time one of the
engineering teams at Google Paris was working on optimizing routes of Street
View cars taking imagery of a city: we took this idea and adapted it into a
Directly modeling a Hash Code problem on an actual engineering project at Google
is something we try to do each time – but it’s not always easy to find the right
200 students in the Google Paris canteen – Hash Code 2014
Scope (who can register)
Preparations for the first Hash Code event were exhilarating! It was a new type
of event for everyone involved and we got to work on things we wouldn’t
otherwise encounter in our day jobs. For example:
how to actually run the competition and score contestant submissions ➡️ we put
together a pretty ad-hoc system, developed on a short timeline by a few very
enthusiastic, but not very experienced in this type of work engineers. (This
only became a problem 🔥 a year later, see Hash Code 2015
does the office canteen have enough electrical power and WiFi capacity for 200
students working on 200 laptops? ➡️We checked with the facilities team and
they said yes – but to be sure, on the day of the event we had a technician
on-call in case we managed to break the office.
how much pizza to order? ➡️ we took the estimate of how much pizza 200 people
can be expected to eat, and then (assuming that students like pizza very
much), we multiplied this by 2.
Most importantly, will the students be interested? We set up a site and sent an
invitation to local universities. The first paragraph of the site read:
Google Paris is excited to organize Hash
Code, a programming competition where you will tackle a real-life challenge
created by Google engineers. Using the programming language(s) and tools of your
choice, your task is to develop an original solution to the problem using your
coding and algorithmic skills. You will work in teams of two to four members and
winning teams will be awarded cool Google prizes. – Hash Code website, 2014
The event was a two-day affair, starting on Friday afternoon with an
introduction ceremony and a practice round using a toy problem. The practice
round was very useful – for the participants, it allowed every team to test
their setup and test-run their teamwork a day before the competition. For the
organizers, it gave us some reassurance that the infrastructure (electricity,
WiFi) can handle the event load.
Saturday was the big day, and it was the test for all our merry preparations.
Things went well – the sound I remember the best was the silence of the canteen
in which 200 intensely focused students worked on solving the Street View car
routing problem. I also warmly remember a few tongue-in-cheek solutions created
by the contestants – in one of them, the Street View cars were scheduled to
drive routes that resembled the word “Google” when viewed from above ❤️. (This
type of playfulness later became a bit less frequent during Hash Code onsite
finals, as the competition expanded its reach and became more competitive.)
The one major issue we encountered was a pizza shortage. It turns out that
multiplying the standard estimate by 2 was not enough – based on the experience
of Hash Code 2014 we now believe that the right pizza coefficient is around 3.5.
The event worked, the students were happy, we were happy, everyone had an
appetite for more. We just had one major issue to resolve if we wanted to
organize Hash Code again…
Pizza more scalable than the scoring system – Hash Code 2015
France, Luxembourg, Belgium, Switzerland
Qualification Round: online
Final Round: Paris 🇫🇷
The main limitation of the first edition of Hash Code was the physical size of
our office canteen – at 200 participants, the space was packed. Even more people
had filled in the registration form and we sadly weren’t able to invite
In the second edition we wanted to enable everyone interested in Hash Code to
participate. But we also wanted to preserve what made the first Hash Code fun –
the feeling of a local community gathering. How can we make the competition
bigger without sacrificing the local feel?
The solution we came up with is Hash Code “hubs”. We invited universities and
developer groups across France to organize Hash Code events of their own at
their own location (and with their own pizza 🍕). We provided the competition
problem and the online scoring system – including a per-hub scoreboard, to help
create an engaging local experience. The best scoring teams in the Qualification
Round were to be invited for the Final Round at Google Paris.
For the Qualification Round, you can
participate from anywhere using your own computer and Internet connection.
However, in order to make the qualification round more exciting, universities,
engineering schools and individuals can organize hubs to gather participants.
– Hash Code website, 2015
Adding the online Qualification Round was the single biggest change in the
history of the competition. Because every year we have many more participants in
the qualifications than we can invite for the finals, the Qualification Round is
our top-of-mind priority and the make-or-break moment of each edition.
Now, speaking of breaking, the 2015 was also the year of our biggest technical
issue to date (knock knock on my wooden desk). Our ad-hoc scoring system
created a year earlier had scalability limitations (related to how the scoring
application was using the underlying database) that we didn’t fully understand
before the event. These limitations became apparent when ~1500 contestants
attempted to submit solutions at the same time. At a few times large groups of
contestants were not able to use the scoring system:
And to make this especially ironic, the
we prepared for the round was about data center reliability… (to be fair, the breakage wasn’t
because of a data center issue. It was purely a problem in the scoring system –
more on this below
The evening was saved by a Google Form – we set up an emergency backup
submission form that wasn’t scoring anything, but allowed the contestants to
continue submitting their solutions to the competition problem. The next day we
spent a pretty tense workday feeding those emergency-system submissions back to
the scoring system and calculating the results.
While the evening of the competition was very tense because of the breakage, we
were reassured by the feedback from the participants and hub organizers –
despite the glitch, people had a good time! On our side, we firmly resolved to
be better prepared for the next year.
At least things worked correctly for the onsite Final Round, for which we
about coordinating Loon balloons
balloons don’t have a propulsion system, so the only way to control where they
go is rely on different wind direction at different altitudes.
For Hash Code 2016, we wanted to expand the competition geographically, for the
first time inviting participants from most of the EMEA (Europe, the Middle East
and Africa) region. With the technical issues of 2015 fresh in mind, we knew
that we needed a bigger boat, that is – a scoring system that can scale.
Our original system was developed with a small event in mind, and we didn’t pay
particular attention to scalability. The development stack we picked was a
combination of a Python application running on App Engine, using a MySQL
database as storage and the Django framework to link the database to the
application. This is a pretty good stack, especially if the primary goal is
development speed. It is also certainly possible to develop scalable
applications on it – especially if you have relevant experience and know which
pitfalls to avoid. We didn’t, and the scoring system was making too many
database writes upon a visit, overloading our MySQL database during the Online Qualifications…
It was possible to mitigate the issue by reducing the number of database writes.
But, as we were thinking about expanding Hash Code, we didn’t only want to only
address the issues that come with the current expected load – we wanted to be
ready for years to come.
So we got back to the drawing board and developed a new scoring system, still
using App Engine to host the application (this part does scale very well) but
now using Datastore
as the backing
database. Datastore is a database specialized in scalability – it has this
beautiful property that things that would be slow in a traditional SQL database,
are just impossible with Datastore. It means it’s harder to design and
develop your application – but once you have it, it’s likely pretty scalable.
Developing this new system in the months before the 2016 competition in a small
team on which everyone was a volunteer with limited time was challenging – but
it was worth it, as the new system worked nicely not just for this, but for 6
Of course, the scoring system was only one element of scaling Hash Code in 2016.
We expanded the network of Hash Code hubs thanks to fantastic new hub organizers
from across the EMEA who joined us that year. We also started to invest more in
preparing Hash Code live streams – more on this below
If the previous edition was a race against time to have a new scoring system
ready, the 2017 edition was when we caught a breath and were able to land some
pragmatic quality-of-life improvements in the scoring system, including
push-notification banner (handy if we need to announce a problem statement
clarification or react to technical issues), per-country scoreboards, a new
experience for hub managers and – behind the scenes – more automated testing.
To celebrate pizza – one of the preferred food type for Hash Code participants –
we ran a practice problem where the challenge was to optimally cut pizza into
Speaking of problem development, we also started to pay more attention to making
the Qualification Round problem easy to understand – after what we felt was a
Delivery drone routing
problem in 2016, this time we run a neat optimization task about
caching YouTube videos
increasing the number of teams who submitted a solution by 3x!
Road to Dublin – Hash Code 2018
Europe, the Middle East and Africa
Qualification Round: online
Final Round: Dublin 🇮🇪
As the office event space at Google France was closed for renovation works, we
needed to find a new home for the competition finals. We settled on Google
Dublin, one of the company’s biggest offices in EMEA and ran a
problem about urban planning
– a reference to the newly re-architected Grand Canal Dock area where the Google
office in Dublin is based.
Another first for Hash Code: two of Google Dublin volunteers who came to help with the Final Round in 2018 met during the event, and later got married in the summer of 2021 ❤️.
Going global – Hash Code 2019
Qualification Round: online
Final Round: Dublin 🇮🇪
By 2019 we had been discussing the if, the how and the when of going
global for at least 3 years.
After long discussions about the logistics, we agreed that the signature
property of Hash Code we want to preserve is the “unity of time” – the feeling
of participating together in one intense, but approachable event. This
determined everything else – for the event to stay approachable, we needed to
keep the original formula of a 4h programming round (longer programming
marathons are less appealing to beginners) and to preserve the unity of time, we
needed to stick with a single Qualification Round.
As we became a global competition, we started to better coordinate and integrate
with the other two global coding competitions organized by Google: Code Jam and
Kick Start, together forming an umbrella brand of Google’s Coding
Competitions. In practice this meant transitioning to a new unified website,
managing contestant registration and contestant profile for all three
competitions. This was a nice simplification, as we went from a triad of systems
(website – registration system – scoring system) to the remaining two.
On 28 February 2019, Hash Code became a global programming competition! We ran a
fun, easy-to-explain problem about arranging a photo gallery in the most
“interesting” way possible (see the
to find out what that means:)). We were happy to see that the problem was
approachable – the best type of posts I personally look forward to is feedback
from people who participated in Hash Code for the first time:
By 2020 our scoring system was battle-tested. We also had a pretty stable set of
processes to manage the competition that we’ve been developing over the years,
including a handy list of backup solutions in case something goes wrong. This
list included some pretty unlikely scenarios such as loss of power in the
But, our emergency plans didn’t include the one issue we encountered during the
Qualification Round on February 20, right after the submission window closed.
YouTube live streaming system had a very short (and rare!)
during our livestream show in which we wanted to announce the results. What were
the chances of that happening? 😅 We could hardly believe it when we realized
that the stream isn’t working.
Fortunately, this was not a critical part of the event – we simply unfrozen the
scoreboard (making preliminary results visible) and sent the livestream
recording link to everyone via email.
The 2020 finals were planned to take place in Dublin 🇮🇪 for the third time. But
before then, the pandemic struck and for the first time we needed to pivot the
finals to take place online. For me, I got to participate in the Hash Code
closing ceremony… from my bedroom. In the end we got some very nice messages
from the contestants who were understanding of the situation and wanted to let
us know they still had a great time ❤️.
Virtual hubs – Hash Code 2021
Qualification Round: online
World Finals: online
The 2021 edition was even more affected by the pandemic than the previous one.
Due to the ongoing disruption and risk created by Covid in most geographies, we
didn’t want to take or encourage unnecessary risks and switched the
Qualification Round hubs to a virtual-only model.
For the competition problems, we intentionally picked two topics not not
related to the pandemic: city traffic lights and organizing software projects.
With all the disruption and hardship created by Covid we wanted to offer an
opportunity to think about and work on something unrelated.
The Hash Code community showed up more than ever before, reaching 111 000
New competition platform – Hash Code 2022
As I write this, we just opened the registration for the 2022 event. Hubs are
once more virtual, but we keep our fingers crossed for the next year.
Very importantly, in 2022 we’re finishing the big unification of the Coding
Competitions stacks at Google – for the first time, the competition will take
directly in the same website
we’ve been using for contestant registration since 2019. This is great news for
the long run of Hash Code and Coding Competitions at Google:
the Coding Competition website stack (unlike the two generations of the Hash
Code judge system) has a very small but excellent team of full-time engineers
dedicated to developing and improving the system (while the Hash Code eng team
are part-time volunteers)
a lot of the functionality of the Hash Code Judge System was also available in
the Coding Competitions system. By transitioning to the new stack, the
volunteer engineer Hash Code team will be able to focus more on preparing the
competitions problem and less on developing the infrastructure (which we
didn’t always get right
most importantly, we hope the new unified stack is a better experience for our
contestants and hub organizers – for sure it’s one less system to jump
between. For the first time all three systems of our original trio (info
website / registration system / scoring system) are replaced by one website.
That said, all change is disruptive and this is a significant change. I hope you
give Hash Code a try in 2022, and if you notice any issues or have feedback
about the competition system – please
let us know
What have we learned so far?
Looking back at the last 10 years, I have two takeaways.
Start small and iterate. There was no way we’d even try to start a global
programming competition as a side project at Google France in 2013. Why would
we? There were already many excellent programming competitions to choose from.
But we did feel it’s worth starting a local event, tailored to what we feel
would make sense in our local context, using the limited resources (including
time) that we had to prepare it. From there, Hash Code grew iteratively,
allowing us to make changes, stumble on a few errors (see the 2015 judge system
issues), learn and correct them.
Community comes first. Each Hash Code edition needs a good competition
problem and a scoring system to run the competition. But the secret ingredient
was always pizza, by which I mean the community behind the competition. It’s
the fact that Hash Code is a team competition that allows contestants to
practice teamwork and enjoy problem-solving more. It’s the Hash Code hubs, led
by community-minded professors, students and organizers around the world that
offer the chance to meet up and build local connections. It’s social media,
online forums and blogs that we all, contestants and organizers, use to share
impressions, tips and feedback.
For the next 10 years of Hash Code I have one aspiration for the Hash Code
community: to stay focused on building a friendly competition that is welcoming
to everyone – and especially to people new to programming events. Looking
forward to seeing what we can do together the next 10 years 🚀!
Thank you to all Hash Code contestants – for participating and for all the
feedback on the competition ✨.
Thank you to the Hub organizers – for the work you put into organizing your hubs
Thank you to all my colleagues on the Hash Code team @ Google – for almost 10
years of working on Hash Code together. This includes:
Hash Code organization team, led by Google Developer Relations (previously
Hash Code was supported by different teams, including the Industry Relations
and the University Relations EMEA team)
Hash Code engineering team, consisting of volunteer part-time contributors
based in Paris 🇫🇷, Zurich 🇨🇭, Munich 🇩🇪, London 🇬🇧 and Singapore 🇸🇬.
Coding Competitions engineering team, developing Google’s Coding Competitions
site and the underlying competition management infrastructure.
Thank you to the many volunteers from various functions and geographies across
Google – for all your help putting together each edition.
A special callout is due to the tireless lead organizer of the first editions of
the event and the discoverer of the Hash Code pizza coefficient, engineering
site lead for Google France, Vincent Simonet.
Stay in touch! ✉️
Join the small group of people who receive a monthly note from yours truly ⬇️.