by kevingadd · 12y ago · 0 comments
And a related anecdote: I was interviewing at Apple for a systems development related role (graphics drivers, I think?) and one of the senior-level folks asked me to write strstr on the whiteboard. I started with a naive, working implementation, then he asked me how I'd optimize it. I said 'knuth morris pratt' and gave a basic overview of the algorithm and explained how it's faster.
He insisted the algorithm couldn't possibly work. I spent a few more minutes trying to explain it, but I couldn't convince him. The dark magic of efficient string searches evades us all sometimes, I suppose. I always like coming away from an interview feeling like I learned something, so I hope he googled the algorithm later. :-)
[1] http://www.sciencedirect.com/science/article/pii/03043975939...
You didn't say which way, I've worked with and for people who wouldn't hire someone smarter than them, the human psyche is a dark place.
Now, if you name a very obscurely named algorithm, that is one thing. But seriously, Knuth!? Is anyone involved with optimizations and serious algorithm design not aware of that name?
https://en.wikipedia.org/wiki/Boyer-Moore_string_search_algo...