Like A Girl

Pushing the conversation on gender equality.

Code Like A Girl

I Did 60 Different Code Puzzles And What Happened Next Will SHOCK YOU

Around 2015 I saw an ad for, I wasn’t really looking for a job but I joined anyway. A few clicks into joining I suddenly found myself in an unfamiliar situation: a screen asking me to solve some kind of anagram with JavaScript. And I didn’t know what to do. I spent about five minutes looking at the screen blankly before simply leaving the site in a huff of annoyance.

The next morning I got an email informing me I’d been rejected from the site. I told myself I didn’t care even though I actually did and proceeded to become OBSESSED with code puzzles. I Googled “code puzzle practice” and joined, one of the earliest code puzzle sites. I put a to-do on my list to practice these puzzles for 10 minutes a day every day.

My daily task on, which is the weird/awesome site I use to manage my life

Since then I’ve learned that code puzzles are a common part of the software hiring process, whether it’s “whiteboarding” or these web-based tests. I realized that I actually had been whiteboarded for my very first job interview out of college and I had been so naive I had no idea what was happening. When they gave me a problem in PHP to solve I actually said “oh I don’t know how to do that, I’d just google it.” I’m pretty sure they were just baffled and I had unintentionally been kind of audacious. They hired me. I got lucky, but next time I didn’t want to be so unprepared.

Maybe I didn’t complete 10 minutes every single day, but I did about 60 code puzzles on Codewars over the next two and a half years. I mostly did JavaScript, and when I got more into Python for my machine learning class I started doing some of the puzzles I’d done in JavaScript in Python.

As I advanced, Codewars gave me harder puzzles, which can take 40–80 minutes to solve. Doing that in ten minute chunks means you’re spending 2–5 of those minutes simply reorienting yourself and remembering your train of thought. So that was the main reason I plateaued out.

The way Habitica works is your score drops if you don’t do your daily every single day 

I continue to be skeptical of the value of these puzzles in hiring, so I’d like to say it was entirely a waste of time. But it wasn’t.

First of all I learned a hell of a lot. In 2015 I’d spent most of my career as a PHP developer and so I honestly didn’t know a lot of JavaScript techniques. I have to credit this knowledge for the fact I’m mainly a JS dev these days. For example, I had no idea what the map method was. Now that I’m doing React this knowledge has really come in handy. I tracked a lot of the JS methods I learned on a Trello board. I used to be afraid of RegEx, but now I’m pretty good since it’s used in so many puzzles.

My study notes on Trello

I also learned a lot more about software testing. Each Codewars puzzle is test driven and you often need to be able to read tests to solve the puzzle. The framework they use it pretty easy to learn and once you contribute your own puzzles you’ll need to write your own tests. I was just starting to use unit and functional testing at work so this practice was pretty helpful.

I occasionally actually used the code I wrote and it often helped me think of new ideas. I created a chatbot called CurlsBot that analyzes hair care ingredients and the original code for it came from a puzzle I solved.

I also became a bit more confident when I encountered these code puzzles in job interviews. But that confidence has its limits. I’ll be honest, they are still a major source of anxiety for me. When I’m doing a code puzzle online I’m in a comfortable environment and have all the documentation of every language at my fingertips. Which is more…like a normal working environment (or should be). Often these tests as part of a hiring process you are put in front of a whiteboard without the internet at your disposal. Or it’s part of an awkward phone call, where I panic and sweat through my shirt while solving a simple number sorting exercise to the tune of awkward silence at the end of the line.

I also like that at this point even most people who use them this way know there is something wrong and they preface it with “oh well now we’ll do a coding exercise, but it’s not like a normal coding exercise, it’s more about how you think about code.” And then it’s just a “normal coding exercise.”

Is there even a point to subjecting me to this? I have to say that this type of code is not something I use much for work. There are exceptions but they are rare. Last winter I wrote a card game for a holiday website and it was a lot like a puzzle I had done. But otherwise most code I work with or write isn’t. The most important thing I probably do is software design and developer operations, which the code puzzles do not test. For me, despite all the practice, they remain a barrier. Unfortunately that means I’ll need to practice more, in interview-like settings. It’s time I could be spending teaching code, contributing to OSS, and in general improving the kind of skills I actually use at work.

Ultimate the fact that the whiteboarding has even become what’s essentially code puzzles was never the intention of the practice. Anil Dash has a great piece on the problems with whiteboarding:

It turns out, the point of this entire exercise was to inspire a thoughtful conversation with a candidate about the way they solve problems. … Like a lot of cargo-cult tech trends, whiteboard algorithm sketching started to go horribly wrong when people started copying a behavior at a superficial level while ignoring the cultural and emotional context that informed that behavior. In short: people copied what was being done without knowing why they were doing it. In this case, instead of finding out how a candidate solves problems, interviewers ended up asking them to perform a ritual that’s mostly about reciting trivia.

I consider code puzzles more a learning resource than a measure of my abilities. As an educational game for coders, I absolutely recommend them. But as far as usefulness in the hiring process, I remain skeptical.