I had a phone interview today, I was able to solve the problem at the first attempt and there was just one bug which i found and fixed it myself. All tests cases passed. Able to do optimization that interviewer hinted me. I got a reject later in the afternoon. I am still wondering for the reasons. Ofcourse, recruiter do not want to share the feedback from interviewer. All interviewers out there, any thoughts.. @Lyft
Maybe someone solved it without a hint. Otherwise no idea.
Exactly. I see a lot of candidates mistakenly believe that the coding interview is about coding. It’s not. Receiving a hint means that you failed at problem solving but they guided you through the problem so that you can have a good experience and learn something from the interview.
The hint was on a space optim ization, but still it does not bring down the space complexity Btw, the solution passed all test cases even before the hint. There was no guidance from interviewer..
You may have taken whole interview just for warmup question. Usually two coding questions
They mentioned at the beginning, it's for 45 minutes I took 35 minutes
Maybe there was a solution with better runtime or memory complexity. Maybe your code was correct but sloppy. Maybe you’re not seeing some edge case. Maybe this was a warm-up problem that usually takes other candidates much less time, and the interviewer never asked their next question. Or maybe the interviewer sucked / was having a bad day.
I would contribute it to my bad luck day
found people who did it faster, no corrections, better background, better school, the stars were not aligned in your favor, list goes in and on. it was a phone screen, chalk it up to bad luck or a large candidate pool whatever and move on
Thank you all folks for your input, just retrospecting the interview multiple times in my mind, I think the questions I asked back to interviewer wasn't so technical. I should have skim through their technical blog... My one cent advice to those interviewing with Lyft, do read up their blogs , or any open source projects they contributed, and prepare some interesting questions to ask them at the end of your interview. It does matter in addition to solving the technical question
Asteroid collision shouldn’t have taken 35 mins. Most prepared interviewees will do it in max 10 mins.
They expect production quality code. Good names for parameters and functions, using comments to make the code more readable.
Was your solution O(n)?
Yes, O(n) And that's the best we can do as we need to look at every item in the input array