My friend gave the onsite interview in fang this Friday, And he got "Median of Two Sorted Arrays" from the Leetcode and after some discussion, he started solving it by the binary search method ( from Tushar Roys video). and when he was in between solution explaining and coding one of the interviewers asked him "Have you seen this problem before"? How can handle these kinds of situations? TC 130K YOE 8
They will appreciate the honesty if he says yes
But their won't be a question that "why you haven't told us, before starting coding"?
"because I decided on this approach myself, and how I solve a problem, either at the drop of a hat, or with consideration, is still relevant to my qualifications."
If the interviewer is so lazy to ask LC, they shouldn't expect people to "not have seen it before". Best answer might be "not exactly this problem but have had similar ones!"
No. For a lazy ass interviewer, honesty is not worth it. Moreover almost all should know that all questions can be reached with enough preparations
“I’ve done a lot of LC so I’m sure I’ve seen something similar”
Nope
I always say I’ve seen it before, I’m not the best liar the world has seen so it becomes obvious quick that I know exactly how to solve it
The interviewer has already made up his mind. No answer is right answer here. Best thing to do is tell him “yes, I have solved similar problems in past” and then give him chance to modify the question a bit. That way he would feel satisfied. If you say no, chances are that the interviewer would just assume you are telling lie. A person who is asking this question has already made up his mind that no one can solve this without knowing it before hand.
The worst thing could happen if you say "yes" is the interviewer would conclude "inconclusive" on the score card. If you are caught lying however, you can be rejected for "bad culture fit".
The only time you should proactively admit it is if the question was asked previously in that same interview round. It comes up in debriefs and, irrational or not, people feel it's unethical if the candidate doesn't mention it. Agreed with previous posts that "I've seen something like this before" is fair - if the interviewer is just taking from LC they shouldn't be surprised nor should they punish you for preparing. I recommend against lying outright.
If asked, you should say you’ve seen it or something similar before (if you say similar be prepared to say the exact problem you’ve seen before — i don’t recommend lying). It will not count against you. What WILL count against you is the interviewer has probably given that same question 50 times and knows what it looks like to solve it naturally and if you just burn through it and say you’ve never seen it before, he’ll know you’re lying and fail you. It’s even worse if you’re a referral because he’ll assume your buddy fed you his question beforehand and he’ll blackball you (speaking from experience).
Say no.