So it took me almost the full 45 minute Google interview to write this. - John Corser
I'm a bit frustrated with myself. I had the opportunity to do my 45 minute google hangout interview for a job as a software developer at Google (2nd round interview), and the interviewer opened with an EASY problem. The problem was this:
Write a method that takes an array of integers between 0 and 100, and returns a string showing the missing numbers. For example: [0,1,3,50] => "2,4-49,51-99″
As any careful programmer would, I asked questions first. Can I assume this array is already in sorted order? Yes. Can I assume there will be no duplicates? Yes. And can I assume all inputs will be between 0-99, or should I handle outside cases? Don't worry about that stuff, just create the string :).
Awesome, so it sounded like an easy problem. I spent the next 45 minutes stumbling over myself, stopping to "think" and generally feeling like I was messing this up big time, before FINALLY hitting my stride at the end of the interview and coming up with this.
Read full article from So it took me almost the full 45 minute Google interview to write this. - John Corser
No comments:
Post a Comment