This year, Thumbtack was one of the sponsors of the PyCon conference. Our sponsorship got us a booth in the conference’s expo hall, and hence the opportunity to tell people what we’re all about.
Everybody with a booth wants to give visitors something to take home, which inevitably leads to the tide of mediocre schwag that barrages people at tech conferences. We certainly wanted to have something to offer, but didn’t want to be lost in the fray of t-shirts, stickers, and flyers.
Our solution: Bring something cool, and convince people to write some code before they get it.
For the conference, we ordered some high-quality beer mugs and shot glasses with our logo on it. The “high-quality” part of that is important – you never know when you’ll be placed across from a booth also offering shot glasses (as we were!). But our neighbor’s glasses looked like they would shatter if you set them down too eagerly after a shot, whereas our glasses have a satisfyingly thick base, giving you the confidence to slam them down (and that they might survive your flight home).
Instead of giving away our glasses, we asked our visitors to first complete a fun programming challenge. We tried solving a few candidate problems before the conference, until we found one that all of our engineers could solve in Python in about ten minutes.
The winning problem was this: Write a program that, given a Connect Four board represented as a two-dimensional JSON array, output which player has won the game, or “No winner” if nobody has won. We printed up this challenge in more detail, and handed out the papers from our booth.
It turns out that, “Interested in a little coding challenge?” is a great hook to bring people over to your booth. (People who go to programming conferences often like to program.) Once people got the gist of the question, they were very likely to ask, “So, what does Thumbtack do?”, and give us an opportunity to interest in more than just our glassware.
We estimate that we gave out about 300 copies of the problem, and got 51 solutions – not a bad conversion rate.
Personally, I’m very happy with how our little experiment went. Instead of lazily offering shirts to anyone who happened to walk over, we gave people a reason to engage with us, and got some people very interested in our mission. I guarantee you that everyone who got Thumbtack schwag at PyCon remembers talking to us, and remembers what we do. How many other small companies at the conference can say that?
Hall of Fame
The challenge in solving the Connect Four problem is not coming up with an algorithm, but coming up with a clean expression of that algorithm in code. Here are some of the best and most interesting submissions we received (all reproduced here with the permission of their authors).
My favorite submission overall came from Sam Merritt, who not only implemented Connect Four in n dimensions, but also wrote one of the best-factored solutions:
A number of people looked at our problem and immediately interpreted it as a matrix problem, and many submissions we got make use Numpy and/or SciPy. There were a number of good solutions in this category, but one of the shortest comes from Renzo Sanchez-Silva:
Conversely, we had a few intrepid people who looked at our problem and apparently thought, “I can solve that using regular expressions”. Unsurprisingly, these solutions had the highest chance of not passing our test suite, but my favorite working regexp submission comes from Dan Callahan, who would like me to disclaim that he was trying for a convoluted solution.
We had a few Python core contributors stop by our booth, and I made (what I thought was) an offhand remark to one of them that I was still waiting for someone to solve the problem with one big generator expression. I clearly underestimated Łukasz Langa, because some time later, we received this:
Finally, in an elegant argument both for and against significant whitespace, we got a solution from Alex Lewin as a 216-character Perl one-liner:
Shameless plug: There’s another way to get a Thumbtack beer mug – come work here! Thumbtack is making it easy to hire any service online, and we’re hiring engineers to help us build an awesome product.