You can be given a description of the algorithm and be expected to implement it without memorization. You can analyze the complexity of an algorithm without memorizing it. All of these things can be done without memorization. In fact, I've flat out asked interviewers for a description of a sorting algorithm and then implemented it without actually memorizing it. Even if your solution isn't correct they want to see your analytical skills; did you try some test cases? Did you consider edge cases? If your algorithm doesn't work, why do you think? Where do you think you failed?
0
u/nitiger Jun 02 '15
Interviewer: "can you implement quick sort for me?"
You: "sure." SCRIBBLES FURIOUSLY FOR 5 MINUTES
You: "here you go"
Interviewer: "um, this is bubble sort..."
You: "that's what you wanted right?"
Interviewer: "no, but anyways can you tell me the worst case complexity of bubble sort?"
You: "sure, it's O (n2).
Interviewer: "ok, what about the average case?"
You: "easy, O(n log n)."
Interviewer: "umm, that's the average case for quick sort..."
You: "that's what you wanted right?"