Disagree with 4. As an interviewer (for Amazon), I will never accept a candidate without a working solution. But I will accept a candidate who writes down the brute force and then walks me through a better solution. I've failed many candidates who tried to come up with the perfect algorithm and ended up empty-handed.
4 is tricky. I am also an interviewer and agree with Sean. Some working code is more important to me than the optimal version. But I don't work at a tech company and my department is producing code that runs mostly in batch jobs. We do have an upper time limit, but as long as the job is nowhere near this limit, we don't waste time on optimizing code.
However when I applied recently for a job at a tech company I focused on delivering a working solution with a test case. It had O(n). My interviewer wanted me to optimize the code and I came up with an O(log n) solution. But it wasn't good enough. I got declined. Directly after the interview I found a clever solution with O(1) on SO.
But I would never decline a candidate in an interview who doesn't find the clever solution, as long as I can talk about optimizations with him and see that he knows this stuff.
Glad you revealed Amazon uses the similar idiot technique for an interview, this solidifies my opinion that I will NEVER want to work for Amazon if it cares so little about it's employees that their test is a fucking toy programming test.
If talking to me doesn't convince you I know my shit, you're doing a bad job at interviewing.
Fahim is the co-founder of Educative, an interactive learning platform that helps software developers become more productive and more successful. Learn more at educative.io.
Education
B.S., CompSci - University of the Punjab; M.Sc., CompSci - University of Washington
Totally agree with you, Sean. It was geared towards candidates who don't even try to find the solution and become content with the brute-force solution. Some candidates don't even try to come out of their comfort zone and that's a red flag.
Disagree with 4. As an interviewer (for Amazon), I will never accept a candidate without a working solution. But I will accept a candidate who writes down the brute force and then walks me through a better solution. I've failed many candidates who tried to come up with the perfect algorithm and ended up empty-handed.
agreed.
4 is tricky. I am also an interviewer and agree with Sean. Some working code is more important to me than the optimal version. But I don't work at a tech company and my department is producing code that runs mostly in batch jobs. We do have an upper time limit, but as long as the job is nowhere near this limit, we don't waste time on optimizing code.
However when I applied recently for a job at a tech company I focused on delivering a working solution with a test case. It had O(n). My interviewer wanted me to optimize the code and I came up with an O(log n) solution. But it wasn't good enough. I got declined. Directly after the interview I found a clever solution with O(1) on SO.
But I would never decline a candidate in an interview who doesn't find the clever solution, as long as I can talk about optimizations with him and see that he knows this stuff.
Glad you revealed Amazon uses the similar idiot technique for an interview, this solidifies my opinion that I will NEVER want to work for Amazon if it cares so little about it's employees that their test is a fucking toy programming test.
If talking to me doesn't convince you I know my shit, you're doing a bad job at interviewing.
Totally agree with you, Sean. It was geared towards candidates who don't even try to find the solution and become content with the brute-force solution. Some candidates don't even try to come out of their comfort zone and that's a red flag.
IMHO both are red flags: candidate who writes only the perfect solution, candidate who writes only the worst solution.
The solution should be a way to discuss (and learn) as many things as you can.