Dear Startups: Stop Asking Me Math Puzzles to Figure Out If I Can Code

I’ve always been pretty good at math. Not trigonometry, or arithmetic, or whatever people are usually thinking of when they’re like, “Oh, you must be smart! I hate math!” But, combinatorics and graph theory and proving things and figuring out how to put hats on prisoners – I love that stuff. I went to three different high schools, and I did math team at all of them. When I was ten or eleven and my parents needed me to shut up at dinner parties, they bribed me with books of math puzzles. No joke.

During my sophomore year of college, I was dating a Computer Science major, and I took some CS classes out of curiosity. To my surprise, CS wasn’t different from math at all. I took my Intro class in Java, so there was some mumbo-jumbo that you put at the top of your programs that went “public something void main something something”, but once you got that nonsense out of the way, it was all sorting lists and putting stuff in matrices and traversing trees. Easy stuff. And once the CS department switched to Python, it got even easier.

So I became a math and CS double-major at my tiny liberal arts school in Minnesota, and my senior year, I started looking for jobs. Turns out, only actuarial firms want to hire people who are really good (but not, like, PhD good) at nothing except figuring out how many ways there are to distribute hats from a coat check so that everyone gets the wrong hat back. So, software engineering it was.

After some research and a couple bad interviews and no small amount of panicking, I found a startup in San Francisco that looked awesome. I interviewed, expecting the worst. But for some reason, my interviewer asked me to find the shortest path between nodes A and B in a graph. (Essentially. I think he said some stuff about Kevin Bacon.) I did so. He asked if I could do better if I knew that A and B were exactly six degrees apart. Yep! Breadth-first search from both ends. Oh wait, you should do that anyway, even if you don’t know how far apart the nodes are! Cool. They flew me out for a full-day onsite interview, where they asked me a bunch more questions that involved sorting things and memoizing things and traversing things, and then they gave me an offer. The entire interview process from beginning to end took six days, and I wrote exactly zero lines of actual code.

Some more relevant things they could’ve asked me, but didn’t:

How comfortable are you with Unix?
I can change directories, list things, and run Python programs. Oh! And rename files. Probably.

Describe how Ajax calls work.
Umm, isn’t that what Gmail uses? It’s like, refreshing the page without refreshing the whole page?

What version control systems are you familiar with?
Oh, we used SVN for our senior thesis project. I accidentally triggered a conflict one time. Someone fixed it for me.

How would you implement a [deck of cards, public garage, hotel reservation system] using object-oriented design?
Variables. Variables everywhere. With counts. And maybe some strings.

Absolutely anything at all about databases.
Huh?

Listen, the very last thing I want is to sound ungrateful. At that first job, I learned all of those things I listed, and more, because the senior engineers patiently sat with me and put up with my stupid questions and never got frustrated with me, even when I got frustrated with myself. But it took me more than a year. And I’ve worked at three jobs since then, and interviewed at many, many more places, and I’ve found that my first startup’s interview style wasn’t a weird fluke. It’s actually extremely common practice. People ask math puzzles to determine programming ability. Why?

In a particularly egregious example of this, when I was interviewing for my second job out of college, I was asked to come up with an algorithm to eventually sink a submarine with unknown (but integral) position and velocity that was somewhere on a number line. (Spoiler alert: to solve this problem, you need to know how to enumerate the rationals.) Once again, zero lines of code. Two weeks into my new job, they told me to write them a consumer iPhone app. Needless to say, I had never encountered Objective-C. I’d written perhaps twenty lines of C in a group project in my programming languages class in college, and all I remembered was that it was terrible and you had to do your own garbage collection or something. My new startup gave me a book called The C Programming Language, pointed me to where I could install the newest version of Xcode, and off I went. Three weeks later, my CTO had a talk with me where he was like, “You’re not getting up to speed as quickly as we expected.” I redoubled my efforts. A week after that, we had the same conversation, but harsher. And then there was a holiday break, and the day after it, I was fired.

I was pretty devastated. I mean, nobody had ever called me a slow learner before. And I had a ton of software engineer friends, and they could all do this stuff. How hard could it possibly be? Why couldn’t I get it?

I promptly repressed my experience at that second startup, talked to nobody about it, joined my third startup (they asked me something about Markov chains), and proceeded to quietly freak out every time I had a 1-on-1 with my new CTO, wondering if I was about to hear that I wasn’t contributing enough, that I’d somehow tricked them into hiring me, that they’d thought I’d be so much better at this.

And I kept struggling, although I did feel like I was learning, and it did get easier. Slowly. But still, I would run into entirely new concepts that I just didn’t have the context for. One time, a few of us got together to code for fun on a Sunday, and someone suggested using node.js, because it seemed like a cool thing to learn. And, looking at some example code, I encountered an anonymous function being passed into another function. I did not get it. Everyone else did! Right away! Even though backend Javascript was new to them, too! So they spent half an hour drawing diagrams with lots of arrows for me, and finally (relying on a lot of metaphors in my head at once), I managed to cobble together a cursory understanding. And then I watched them pass their callbacks around in their code, and it was still magic to me, and I felt so dumb.

Recently, a close friend of mine began learning to code, and I found myself explaining stuff to her. Pretty basic stuff, like the difference between static and instance variables, and how inheritance works. And it dawned on me that I was using all these words like “class” and “object” and “method”, and I knew what they meant, intrinsically, without having to think about it, because I’d been using those words and those concepts for years. But every time I said one of those words, I saw her trying to remember what it meant, what properties it had, and how it fit with what I was saying, because somebody had just written the definitions of all those things on a blackboard for her not two weeks ago. And I realized (it took me that long to realize) that I couldn’t just transfer three years of software engineering experience to her by building and building on stuff I’d already explained. Brains, apparently, don’t work that way. Not like codebases.

It seems like a lot of interviewers think that CS theory and problem-solving skills are the important things, the difficult things, and if you know them, everything else is easy. It makes sense that they think this, because a lot of them have been coding since they were twelve, and they get how to code the same way I get how to solve puzzles. And they probably didn’t learn the theory side of it until college. But me, I’ve been practicing problem-solving since I was ten. So I feel like I’m in a pretty good position to say: programming is fucking difficult. Just as difficult as problem-solving, if not more so. And just because I breeze through your common-elements-in-unsorted-lists and linked-list-cycles and paths-through-grids problems, doesn’t mean that I’ll learn all the new coding stuff I need to know in my first few weeks on the job.

I mean, I’m getting better at it. I feel like I’m finally on the other side of the sheer confusion in the beginning. But I’ve been doing this for over three years now. And there’s still a long, long way to go before I’m anywhere near as good at programming as I am at solving math puzzles. So please, future interviewers, ask me a coding question. You’re trying to figure out if I can code. And I’m not trying to trick you! I want you to know! So there is absolutely no reason for this roundabout nonsense.

119 thoughts on “Dear Startups: Stop Asking Me Math Puzzles to Figure Out If I Can Code

  1. I would like to think where this general thinking that “hey he can solve this problems” came from… and from this they assume who is a good worker?

  2. twdyen says:

    Okay, you’ve got lots of comments. So, another problem is that if you work on the front end, programming is more important than math. I agree here, because user-friendliness is indeed a problem for artists and not math wizards. Unfortunately, most artists can’t code, so you need a bridge between the graphics API and the artists. It’s like MIS or management information systems. I actually don’t remember whether it’s plural or singular. If that’s what you want, sticking to programming is a good call. Most bridge jobs tend to be very boring and communication skills are actually way more important in this case. Market research is critical as well, because your intuition may not be the popular taste. It’s like fashion, where taste evolves and you always have to follow. If you love long hours, fierce wage competition with India and sucking up to those so-called artists, have fun!

  3. Jon Ferrera says:

    I dislike math, but especially knowing that I am doing math. I don’t mind being tricked into doing something I don’t know is actually math if it means I can have fun doing it. I was asked some coding questions during the interview for my first job out of university, but none of that was in-depth as I expected. Although my employer knew I could code, I was given an elementary program to code and compile. It was actually a few months before I was able to create or modify applications for a live project. Still, some topics come easier to people than to others. I mentioned that I don’t like math. I don’t like it even more since I understood it easily and had to explain it to people who genuinely loved math, but did not grasp it as quickly. Yet… I did love helping people do what they love. Even if my face never said it.

  4. T.I.E. says:

    There are a lot of problems with interviewing styles everywhere, especially at tech companies. The interesting thing about your scenario is that most CS kids don’t explicitly have math training in their background, so what you call ‘math problems’ are to other people ‘logic problems’. Since somebody can be an expert programmer in Python but be clueless when it comes to Java or C++or vice versa, they try to test generalized “programming-ish” knowledge as a proxy for programming ability. I am surprised that you didn’t hear any pseudo-code questions though. Lots of companies will at least have you whiteboard a problem in half-code, half-English.

  5. tusassdelucca says:

    I appreciate you. Thank you. I’m taking an online javascript class & it seems basic… except I keep having grammatical issues & my shit don’t work. Arrrrrgh. OK, it’s not my first or second language & it might take a little time to get the hang of & speak fluently. Yes I feel all alone & pretty stupid sometimes. But I can figure it out eventually. I just need a little peer response & encouragement… Is that so wrong?

  6. Jean says:

    “But me, I’ve been practicing problem-solving since I was ten. So I feel like I’m in a pretty good position to say: programming is fucking difficult. Just as difficult as problem-solving, if not more so. And just because I breeze through your common-elements-in-unsorted-lists and linked-list-cycles and paths-through-grids problems, doesn’t mean that I’ll learn all the new coding stuff I need to know in my first few weeks on the job.

    I mean, I’m getting better at it. I feel like I’m finally on the other side of the sheer confusion in the beginning. But I’ve been doing this for over three years now. And there’s still a long, long way to go before I’m anywhere near as good at programming as I am at solving math puzzles”

    That’s great you are writing about this and revealing to others what it is really like, instead of bluff and bravado.

    I’m intrigued by this method of interviewing in the programming world. There’s something hopelessly male and narrow-minded about this. Maybe part of the challenge for recruiters is that programming language changes every few years.

    I’m not a math person –I just know enough to massage and read data at …and for managers. I know what they want..because I’ve been a manager.

    Have you ever thought of switching careers..maybe get more into client services..handling big client accounts? You would be in an excellent position to handle clients who have IT dept. and create that bridge of understanding between your firm’s capabilities and client needs. And kick the poop out of IT people who pretend or claim something that software may not be. Part of the problem is that senior managers make VERY expensive long term technology decisions but really are not equipped to ask the right questions because they have never designed an application, never done any simple lines of programming. So the IT world lassoes them in for some expensive technology for a simple application.

  7. I think it’s like anything though. Some people are just naturally better at things! Who know’s why.
    Keep at it. You’ve come so far! Well done 🙂

  8. Monica DiNatale says:

    My brother was a math major in school. I hate math!

  9. strainofthought says:

    Problem solving is one of the hardest things to teach.

  10. Math is about the numbers but only in terms of their social content and application. It doesn’t even matter if it is pure math or applied because eventually equations only make sense in the social domain. This is indeed in contrast to other sciences which use math….

  11. My husband is a software engineer and I started my career as a web designer and so we easily covered two opposite ends of the spectrum. Like your friend, I found myself taking an intro to Java class and a Logic course in college and could not wrap my head around these “math” courses. Honestly, that’s what my college considered them. I sought help from my husband and I quickly found out that he was much like you – he understood the logic concepts at a core level, he didn’t even need to think about how to get to point B from point A and he couldn’t explain to me WHY you needed to code something a certain way.

    After fighting my way through understanding these courses, he explained to me the interview process he went through for his job as a software engineer and let me know that these sort of logic problems went hand-in-hand with the interview process – which is why he was so good at them. The problems where you found out how to give every party guest the wrong hat back was the sort of nonsense he dealt with at work – and I couldn’t understand a word of it.

    Outside of basic Java, Visual Basic, HTML, and CSS coding – I’m a complete moron. I probably even made a goof calling it CSS coding, but that’s why I’m a writer by trade and my husband, like you, is a software engineer.

  12. dragomanm says:

    sorry to bother you,need your feedback regarding my travel packages in Egypt,Thanks in advance 🙂

    Home

  13. This article is so good, I like this blog, Thank you very much for sharing

  14. Ditto!

    Great read!

    Can I have the number for the patient engineer at your first startup, LOL! Why are people so out of patience?

    We must keep practicing and we will become experts!

  15. Reblogged this on Research Intern and commented:
    Ditto to the entire post! Great read!

  16. David Price says:

    Most other industries actually ask for your experience, what you can or can’t do.

  17. […] the other day I read a blog “Dear Startups: Stop Asking Me Math Puzzles to Figure Out if I Can Code“. I could not believe that anyone thought it would somehow be a good idea to ask candidates […]

  18. Emma, I suspect two main reasons for this kind of interviews:

    1. You are applying to a start-up, which implies you love coding, which implies you have experience programming. That’s the company assumption. Thus interviewer only needs to check other areas, such as critical thinking, ability to express your solution, etc. Yes, it is silly they don’t check their assumptions, but then again they trust you!

    2. Typical interview is still 2~4 orders of magnitude shorter than how long they expect you to stay on the job. It is simply impractical to hit you with a hard programming challenge, I can’t see a single applicant being able to program, test and debug, say, TSP approximation in euclidean domain during an interview, whether 1 hour or whole day. And if someone could, that would only be by virtue of having done it before. Thus the focus is on the first part, mathematics, rationalization, proof sketch.

    Perhaps you’d like to know that when I interview someone, I start with simple coding task which gradually evolves into algorithms, e.g. from timing decorator to percentile approximation, and I test their code while they write it. If a candidate is good enough to get through that in an hour, why not hit them with median-of-medians 😉

  19. Steven Mannus says:

    I think this trend is somewhat annoying and borderline disrespectful, but I get it. I think startups create some crazy kinds of applications or code tests because they often get posted on a lot of blogs and things. It’s an easy way to get free publicity, which isn’t usually easy for a startup to get. Ever tried to pitch somebody at a big media magazine about your service? You’ll have to basically fellate them in order to even get their attention. That explains the popularity of social media to startups and why there are so many companies listed at http://www.buylikesreviews.com for instance – it’s a system where there are no real gatekeepers like in the traditional mass media world. Hiring programmers is hard and getting media attention is hard, so I can to some extent understand why they do this.

  20. Ajinkya says:

    Really it make no sense asking programmers to write maths puzzles.

  21. page says:

    Do you have a spam issue on this site; I also am a blogger, and I
    was wondering your situation; we have developed some nice procedures and we are looking
    to trade techniques with other folks, why not shoot me an e-mail if interested.

  22. […] Dear Starups: Stop Asking Me Math Puzzles To Figure Out If I Can Code […]

  23. […] Dear Startups: Stop Asking Me Math Puzzles to Figure Out If I Can Code (via Cameron Presley) […]

  24. Hi,
    Very interesting & so good to see that you are very frank about it all !
    The issue here, however, is that a company assumes that a CS major(or somebody nearby) would be having a sufficient(as per company requirements) experience in at least one language.

    Now, based on this premise, what they conclude is interesting –

    1. A person having sufficient knowledge of one programming language can easily switch to other programming languages with relative ease.
    Now, this conclusion is true when the first language is “C”(or any other middle-level language) in combination with the knowledge of OOPS concepts , but not “so much” if one just has a smattering of a language.

    2. A person being very good at maths + 1 programming language is a “potential master” or one should say, “a master in waiting” at other programming languages and almost all CS stuff. Thus, companies keep the maths skills as top priority.

    I, personally, believe in the 2nd point. I don’t think that there is any flaw in the 2nd conclusion. But, the companies should work on the verification of their assumptions(if any) to make the procedures foolproof.
    So, the solution doesn’t lie in stopping to ask maths/puzzles but, to add the coding part too, which most top tech recruiters of the world are embracing through coding competitions, online coding rounds, 1 day work as employee, etc. The algorithm part tests the maths & logic and the necessity/obligation to code tests the OOPS & other aspects.

    Thanks
    QoE

    PS : This makes me think that the title of the blog is dubious !

  25. Y ahora, para más inri, te encuentras con una avería consistente en que no calienta el calefactor, Y sale el Servicio Oficial del Fabricante y te dice que para ir a tu casa a reparar el aparato, como han pasado ya los 6 primeros meses de uso, debes pagar el desplazamiento. Todas las reparaciones de lavadoras están garantizadas por escrito y tienen tres meses de garantía.

  26. […] A post on the practice of asking potential hires tricky math problems – even if they are going to be hired to do something else (like software engineering). This happens all the time in academia as well – often the exams we give/questions we ask aren’t neatly aligned with the ultimate goals of a program (producing innovative/determined researchers). […]

  27. Oh, i want marrige with that woman 8)

Leave a reply to T.I.E. Cancel reply