Do programmers encounter all sorts of algorithms when engineering software? In my experience, the only things I really need to keep in mind what are the consequences of certain data structures and algorithm types rather than their specific implementation, because often the implementations are built-in to the language, but the choice of which implementation of data structure and algorithm to use are more important. I use sorting algorithms very frequently. Usually it is just a call like "list.sort()".
Yet in interviews, the questions I get asked are more like "Implement <My favourite sort> in 20 minutes, no googling.
I mean, really?
The other day I was in an interview where I had to implement a queue in 30 minutes. The unit tests were already written and the IDE was eclipse.
I wrote the "correct" implementation for the queue in about 10 minutes but there was a bug I couldn't find; I've never used eclipse before and took a lot of time figuring out everything. In the last minute I finally tracked down my bug. I forgot to increment a variable. I fixed it and all the tests as well as the performance test passed. I didn't get the job because I took too long. (It was a graduate position and the last time I used Java was 2 years ago)
I was distracted with all the buttons on eclipse... Otherwise I'd never have missed the variable increment! I swear. Anyway the point is, if a programmer is ever implementing their own simple Java queue in production software it is not a good sign anyway. Why are you testing for that?
Yet in interviews, the questions I get asked are more like "Implement <My favourite sort> in 20 minutes, no googling.
I mean, really?
The other day I was in an interview where I had to implement a queue in 30 minutes. The unit tests were already written and the IDE was eclipse.
I wrote the "correct" implementation for the queue in about 10 minutes but there was a bug I couldn't find; I've never used eclipse before and took a lot of time figuring out everything. In the last minute I finally tracked down my bug. I forgot to increment a variable. I fixed it and all the tests as well as the performance test passed. I didn't get the job because I took too long. (It was a graduate position and the last time I used Java was 2 years ago)
I was distracted with all the buttons on eclipse... Otherwise I'd never have missed the variable increment! I swear. Anyway the point is, if a programmer is ever implementing their own simple Java queue in production software it is not a good sign anyway. Why are you testing for that?