3 ms·
I don’t think this person would have done badly on the interview if they hadn’t practiced the question in advance. At least according to the narrative, when the
by masto 4y ago
I don’t think this person would have done badly on the interview if they hadn’t practiced the question in advance. At least according to the narrative, when they first heard the problem they thought about summing the numbers: presumably they would also have gotten there during the interview.
It also begs the question that a direct path to “perfect code” is the intended goal. Admittedly this story takes place quite a while ago and there’s no one approach to interviewing in big tech, but I think it’s safe to say it’s generally a more nuanced evaluation. In a situation like this, the textbook approach is to start by proposing a quick and dirty naive solution, like storing all the seen values in an array, and telling the interviewer why or under what conditions you think it’s a bad solution. You could realize that there’s only one bit needed, so you could track eight values per byte. That’s probably the point at which the interviewer might prompt you to start coding, since there are a few details to get right to show that you know how to implement a simple algorithm, and there’s opportunity for followup about boundary conditions, scaling, big-O, etc.
At that point, you may have enough time for another prompt like “can you think of a way to do it without an array to store all the values?” If the candidate is still stuck, I’d offer them “what if I give you this formula for the sum of the numbers from 1 to N?” Similarly, if at some point earlier on they said “I think there’s a formula for this”, I’d probably give them a minute to think about it and then just tell them what it is. Because I want to move on to see if they can implement it.
Are a lot of FAANG interview questions math puzzles pretending to be programming questions? Unfortunately, yes. It’s hard to avoid when you have a people who are smart at math and not particularly skilled at interviewing. They tend to create questions based on something they’re impressed with themselves for knowing. I’m not suggesting anyone has solved the problem of how to decide, based on 45 minutes talking to someone, whether they’re going to be successful at the job.