Like you know the optimal solution, it would be dishonest to hide that from your interviewer since it's an assessment of your skills. But on the other hand, interviewing is a crapshoot anyway and any advantage helps?
You use search on blind to find the answer for a previously asked question.
The interviewer may think so and if it was me I'd fail you. If all your answers are at a certain level and then one part you are super good it may be bad for you
You mean if I’m Chinese and you’re Indian
If you never seen it before, you will probably get bombed and eliminated. So, hope your previous LCs will cover it.
Take up most of the time to expertly solve it. Then theres no time for question 2 and you look like a gangster my friend. I read about that trick on the line.
Why? Why would you ever say you've seen it? It's a freaking rat race and if you say you've seen it, someone else won't and you won't have a chance. If an interviewer cares enough, THEY should be asking something new.
What if you solved all LC ? There are people around here who have done many hundreds of questions so the likelihood they have seen it is high. What are they going to be asked ? Isn't the point of practicing before the interview to prepare yourself ? I would admit I saw the question before if the interviewer asked. Otherwise I see no point and no dishonesty. It's a hypocrisy to reject the candidate because he knew the question and the answer.
i told the interviewer that i solved this question before. She was impressed with my honesty. Depends if you are confident that you can solve questions on the fly
Did she end up asking you another question?
I was asked a question that was equivalent to a problem I'd solved in code recently. There was no lying involved, I just explained the solution, while being silently amused. But that might be significantly different from the scenario you were thinking of. If I know the solution because, say, I've been in nonstop interviews for the last week, I may keep that to myself. Or, if it feels like I could get points for honesty, I'll mention it unprompted. But it's absolutely a game and I would try to play this somehow to my advantage.
I say that I’ve seen a similar question
Many times, even if you know the solution, you would be surprised to reproduce the solution again...Also, maybe, there is another interesting way to solve it or code an optimal solution...
Embarrassingly enough, this happened to me in the past. Practiced a question with some friends over a weekend, understanding the optimal solution. Had two interviews the two following weeks. Pushed out the optimal solution in a smooth manner during the first interview, and completely blanked on the second for an unknown reason. Was able to code it out again at home a couple days later. Strange how the mind works sometimes.