
Facebook Lost a Great Engineer
(Alternatively “Puzzles are Bullshit” or “Don’t Mess Up Your Interviews”.)
In early 2011, I interviewed for an internship with Facebook. I didn’t get the internship. In the long-term, this turned out quite well for me.
When I was rejected, though, it hurt. Now, with the perspective of an employer, I realize that Facebook is messing up their hiring quite badly. Allowing their developers to conduct interviews has led to a culture of puzzles, and puzzles are bullshit.
(For the purposes of this article, I’m considering algorithms to be a puzzle. The only exception I can think of is a game engine developer, or other low-level developer. And to be clear, this article isn’t really about me, or about Facebook.)
Some Puzzles Check for Formal Education
For most of the questions Facebook asked, I was able to answer very quickly. Why? Because I had an interest in formal computer science. I had not, however, ever used the knowledge in the real world which was needed to answer any of these questions.
How often do you expect candidates to write a function to calculate the square root of a number? I would fire any developer who chose to re-implement standard library functions.
It’s a well-established bit of culture, at least in most smaller companies, that hiring people without degrees is perfectly acceptable. Hiring on the basis of questions like this serve only to make those without a formal education feel stupid.
It makes sense, in some ways. People who’ve gotten a formal education have been quizzed mostly on the basis of algorithms, so asking puzzles whose answer is an algorithm makes sense.
But, as tests like FizzBuzz show, answering questions in school doesn’t correlate to an ability to code.
Some Puzzles Are a Game
The claimed benefit to asking questions like this is to see how candidates think. That often means the question requires withholding key information from the candidate, and watching as they try to figure it out.
Except, there are plenty of questions with real-world implications to ask before having to resort to questions like “How many piano tuners are there in Chicago?”
Developers, as I’ve mentioned before, seem to often be in search of “hacks”. Hiring is no exception, and finding simple questions which can quickly determine the skill of a candidate does indeed seem cool. In this sense, puzzles seem ideal.
Beyond that, they’re fun. Many of the questions often-asked are a nice break from the usual questions going through one’s mind while programming.
In this sense, asking puzzle questions might be a good way to look for culture fit. This is fine, so long as you’re constantly aware that hiring based on puzzles is good for exactly one thing: hiring people who are good at puzzles.
No Puzzles Test Useful Skills
Being able to solve puzzles does not correlate with being a good developer. dhh wrote about how stupid solving puzzle interview questions made him feel.
On the flip side, one company which is usually quite awesome came up with “an interview question which actually works” - a CSS trivia question involving footers, which their developer admits he couldn't have solved in an interview. “Lucky for me, I already work [there].” They actually conducts their interviews in an excellent way, by working with the developers,but focusing on this question would give you totally the wrong idea.
More examples are everywhere. Microsoft is famous for them, leading to a book, How Would You Move Mount Fuji? My co-founder recalls an interview focusing entirely on bitwise operations for a position developing fairly run-of-the-mill iOS apps.
The best example, however, comes from my personal life. A good friend of mine (and a Facebook employee), complained about a candidate he’d interviewed earlier being unable to write a function which merges two sorted arrays with O(1) memory, given a half-null-filled first array. This sort of question is totally inapplicable to the real world in two ways: unless hiring for someone to optimize PHP, this sort of question will never get used in the candidate’s job, and requiring a half-null-filled array to be passed into a function is terrible real-world practice.
Another hilariously wrong answer comes courtesy of my friend Michael Tang.
My Interview With Facebook
Finally, here’s how my interview actually went. Solutions are at the end.
Facebook, like many companies, does hiring by having developers screen prospective developers. The interview was with three people, and the questions were as follows:
Interview 1
What’s the pattern here?
1
11
21
1211
111221
Write a function to remove all instances of a CSS class from a string containing HTML.
Interview 2
Given a grid of any size, find the maximum value of the sum of a 2x2 square in the grid.
This question was actually quite poorly posed, initially. This is word-for-word what the interviewer asked, as per my notes, but it turned out that he actually meant something different:
Given a grid of any width, but a fixed height of 2, …
Interview 3
Write a function to calculate the square root of a number.
I did fine in the first interview, having known the sequence from Wikipedia. Removing a CSS class was possibly the only good question in the interview, although its real-world implications were still minimal because never parse HTML without a proper HTML parser.
The second interview points out a smaller problem about puzzles not worth mentioning in the main post: they’re often difficult to explain.
The third interview, much like the first, relied on rote textbook knowledge of algorithms. I was actually expecting something harder, and tried to implement a more efficient algorithm than the interviewer was familiar with. He eventually told me he was looking for binary search, so I implemented binary search from memory. I believe he considered this cheating and failed me, because I never got a call.
Facebook’s Loss…
As I mentioned earlier, I felt, at the time, like my failure in the interviews meant I was a poor programmer, particularly in the second interview.
Today, I realize I’m a pretty well-rounded and high-performing developer/engineer/architect. At the scale of Facebook, I’m exactly the sort of engineer I’d want many of.
This article is obviously somewhat over-stated, and it’s not really about me, or about Facebook (who, I’ve heard, has changed their hiring to remove these sort of nonsense questions). It’s about the large number of companies who are simultaneously complaining about a lack of talent, and disqualifying large swaths of it.
…Is Our Gain
Let’s be clear, Facebook clearly isn’t picking up poor-quality engineers, and, in general, being good at puzzles often implies being a good programmer.
Being good at puzzles isn’t a necessary condition for being a programmer, though, and those of you versed in logic might have picked up on the empty space I’m alluding to.
Facebook’s puzzle culture is causing them to turn down a lot of good engineers, and that gives everyone else a larger talent pool. At my current company, we hire based on provable real-world experience.
You need to train whoever’s doing hiring to ask useful questions. Stress the importance of not trying to be witty or tricky.
The easiest thing you can do to start hiring more intelligently is to look at past code. In practice, this means asking for their Github username or some sample code. (Of all the resumes I’ve received recently, only two didn’t have any links to open-source code.)
What better way to figure out what sort of value they’ll bring to you, than to see what value they’ve already been creating?
Footnotes
The first question of the first interview is called the “Look and Say” sequence, and I’d recommend just reading the Wikipedia article, because it’s just trivia.
The second question of the first interview is trivial to do in regex, although, as I mentioned, using regex to parse HTML in the real-world is usually a bad idea. (We’ve all done it, though.)
The second interview was a sliding window sort of thing.
The third interviewer just wanted me to use binary search. This is a pretty bad idea in the real world.
At Framebase, we conduct our interviews in such a way that we minimize issues like this, but if anyone has any feedback on our interview process I’d be happy to hear it.
(Updated 11:25am, because Medium hides the side-notes to logged out users, and to clarify about a question asked by a friend. Updated 12:30pm to clarify at the beginning of the article.)
Email me when Tyler Menezes publishes or recommends stories