Life, the Universe and Technical Interviews
diegobasch.com
Life, the Universe and Technical Interviews
1–10 of 15 posts
Re: Life, the Universe and Technical Interviews
#2Re: Life, the Universe and Technical Interviews
#3It is amazing how many seemingly knowledgeable, intelligent people cannot do this. And the vast majority of those who do, do it by sorting the array, efficiency be damned.
Actually, I'd like a bit of feedback here. Is this something any decent developer should be able to do with ease? Should it be obvious that it can be done much more efficiently without running a sort on the array? Admittedly there are minor gotchas with things like the initial conditions, but still, I've been flabbergasted by how few people can even get close to a solution, let alone a bug-free and efficient one.
Re: Life, the Universe and Technical Interviews
#4I tend to ask what I think is a rather simpler question in most interviews: find the sum of the two largest (most positive) numbers in an array of arbitrary integers. Consider the efficiency of your solution for very large arrays. It is amazing how many seemingly knowledgeable, intelligent people cannot do this. And the vast majority of those who do, do it by sorting the array, efficiency be damned. Actually, I'd lik…
It's okay if they pull out the sort-the-array solution first, but I'd definitely try to get them to improve it.
Re: Life, the Universe and Technical Interviews
#5Re: Life, the Universe and Technical Interviews
#6I tend to ask what I think is a rather simpler question in most interviews: find the sum of the two largest (most positive) numbers in an array of arbitrary integers. Consider the efficiency of your solution for very large arrays. It is amazing how many seemingly knowledgeable, intelligent people cannot do this. And the vast majority of those who do, do it by sorting the array, efficiency be damned. Actually, I'd lik…
Why would you sort?
Re: Life, the Universe and Technical Interviews
#7I tend to ask what I think is a rather simpler question in most interviews: find the sum of the two largest (most positive) numbers in an array of arbitrary integers. Consider the efficiency of your solution for very large arrays. It is amazing how many seemingly knowledgeable, intelligent people cannot do this. And the vast majority of those who do, do it by sorting the array, efficiency be damned. Actually, I'd lik…
Thinking back how many people verified that the array was non empty and it had more than one element? I call it the toy problem mindset, when coding you consider things deeply but in meetings your looking for roadblocks not optimal solutions.
PS: From a preformace standpoint sorting your array is relativly better than ant of the posted solutions. Even though the article links to a much faster method. Aka there x log x solutions when a log x solution exists.
Re: Life, the Universe and Technical Interviews
#8Re: Life, the Universe and Technical Interviews
#9I tend to ask what I think is a rather simpler question in most interviews: find the sum of the two largest (most positive) numbers in an array of arbitrary integers. Consider the efficiency of your solution for very large arrays. It is amazing how many seemingly knowledgeable, intelligent people cannot do this. And the vast majority of those who do, do it by sorting the array, efficiency be damned. Actually, I'd lik…
Solution is just to have two indices into it leapfrogging as they find the next biggest one, right, and sum at the end if they've moved? Why would you sort?
Want to apply to our full stack developer position?
Edit: Out of curiosity, what would you initialize the two tracking variables to?
Re: Life, the Universe and Technical Interviews
#10I tend to ask what I think is a rather simpler question in most interviews: find the sum of the two largest (most positive) numbers in an array of arbitrary integers. Consider the efficiency of your solution for very large arrays. It is amazing how many seemingly knowledgeable, intelligent people cannot do this. And the vast majority of those who do, do it by sorting the array, efficiency be damned. Actually, I'd lik…
I'd expect anyone I interview to be able to do that, kind of like fizzbuzz. It's okay if they pull out the sort-the-array solution first, but I'd definitely try to get them to improve it.