I frequently get asked "classic" questions during coding interviews and I am always confused how to handle myself in these situations. Of course I'm not talking about the warmup questions like "reverse a string" or "fizzbuzz", but non-trivial one, like a harder puzzle, or an algorithm (e.g. today I was asked to implement the maximum subarray problem). I feel that if I just write out a solution to a harder problem like that on the whiteboard I will be misleading the interviewer into thinking I am a genius I am not. Faking a slow thinking process seems dishonest and wrong. Saying flat out "I know how to do this because Glassdoor says you ask this question" is also not ideal... Note: I am specifically asking about hard and not super-widespread problems.
Just solve the problem. You won't come off looking like a genius if the interviewers are competent, you'll come across as someone who prepared well and has experience.
I'm not a programmer but I have so much experience as an engineer that I have often made problems seem trivial even after a team of guys have been trying to work it out for half a day. Professionals even in other fields recognise this as experience, not genius.