Are we expected to derive specialty algorithms like Boyer-Moore on the spot?

In a mock interview, I was expected to implement a simple string search algorithm. The interview then asked for a linear string search. I mentioned Rabin Karp (something I had memorized) and the interviewer asked for a different approach.

As part of the feedback afterwards, I asked if he'd expect an interviewee to know Rabin Karp. He said no and he actually would prefer if I didn't. He said he's assessing my problem solving skills. As a practice suggestion, he said that I should come up with a linear string search algorithm in 20 minutes and google boyer-moore if I get stuck.

So what gives? Are we expected to derive boyer-moore or rabin karp from scratch with no knowledge of them? This interview is demoralizing for me, even if I had excellent problem solving skills there's no way anyones deriving those algorithms from scratch. Was he expecting me to think about way and guide me towards boyer-moore?

Comments (0)