So I was interviewing today with one of the Big 4 tech giants and I was asked an algorithmic question. Before I start explaining my solution, I ran through all the famous data structures in my head and had a very clever idea of using a Map which reduced my naive solution from O(N^2logN) to O(N). I proceeded to explain my solution clearly and coded it up. The interviewer asked some followup questions about them and he said that this was indeed the optimum solution.

Now after I finished the interview, I started getting worried because I am wondering if the interviewer would think that I knew this question from before and just wrote down the answer I know. Do interviewers generally think that anybody who gets the optimum solution from the start has most likely seen this question before?

EDIT: I got the internship :). I guess I got my answer.

  • What Joe said. Interview questions are as much a filter for them as they are for you. Anyone who rejects you for coming up or remembering the optimal solution for their interview problem is probably doing you a favor...
    – Kempeth
    Jun 27 '17 at 6:12
  • 1
    Congratulations! ;) Jun 28 '17 at 8:04
  • Statistically speaking, even when the question cannot be known before, some of the applicants (if there are enough of them) should come up with the optimal solution (even if it is more by chance than by knowledge).
    – skymningen
    Jun 28 '17 at 9:12

Do interviewers generally think that anybody who gets the optimum solution from the start has most likely seen this question before?

Possibly, but it doesn't really matter. The typical interview process is not really about knowing (or not knowing) specific answers; from an employer's perspective it's about whether you have knowledge and experience in a given problem domain, and if you can solve the business problems that they face.

If you've seen a problem before and know the answer, that's called "knowledge." Employers want knowledge. If an employer is asking knowledge questions, then being knowledgeable is an asset.

However, sometimes overly-clever solutions or memorized answers are unsuitable for solving real-world problems. Being pragmatic and being able to apply previously-learned knowledge to new problems is called "experience." Employers value experience. If an employer is asking problem-solving or experiential questions, then being experienced is an asset.

Some interviewers rely on tricky questions to filter people out of the hiring pipeline, but you'll never fail an interview for being knowledgeable or experienced. The follow-up questions were likely designed to ensure you had given an answer from real knowledge or experience, rather than luck or rote. If you demonstrated either knowledge or experience in your follow-up answers, no reasonable1 interviewer would see a correct answer as a negative.

1   Obviously, if the interviewer is unreasonable or insane, all bets are off. Back away very, very slowly. When you have safely exited the building, find another company to work for.


As an interviewer (and also when I have been an interviewee) this is not a bad thing. It happens from time to time. At most, it may be a problem for your interviewer, as he will need to adjust the flow of the interview slightly - but that's his problem, not yours.

From your side, the important things should be:

  • Did you explained thoroughly how to reach to your solution?

  • Did you wrote a reasonably clean (and good) code?

  • Did you address properly the follow-up questions?

  • Did you behave properly during the interview? (i.e. friendly, not boasting too much about knowledge... you know, not being that guy)

If so - and it seems you did from your description - you shouldn't be worried at all. Business rules sometimes dictates that a technical interview must follow a path (thinking, naive solution, discussion, improvements...) and take a given amount of time, but all that is still arbitrary.

And IMHO, when I have in front of me a candidate able to cut to the chase and solve the problem flawlessly, the last thing in the world I am going to do is to provide negative feedback.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .