← Back to context

Comment by gspetr

43 minutes ago

I don't understand how you jumped to the membership test instead of literally the .find() method on a string?

The interviewer is not asking to solve a problem here, they're asking for a simple ability to follow instructions, hence the offer to use Google to find the correct answer.

You could make a very solid case for using "in" (it is 2-4x faster), but only after you've solved the task at hand, this is what is expected in interviews. Not knowing the interview meta makes an average Joe basically unhireable in this market.

The unfortunate answer is just that I didn’t think of .find before thinking of “in,” haha. Nothing too clever going on in my head.

The existence of a more conventional .find method does some damage to my original point. Oops.

  • No worries. My point is, if you get asked questions that seem simple to the point where you feel they're asking if "water is wet", then you need to keep your own thinking process extremely simple in response.

    The reason is the intent behind their question, which they don't vocalize.

    This question means we are dealing with an extremely broad hiring funnel designed to fail people who can't FizzBuzz and need to keep answers at MVP level.

    In other words, if you are asked to put out a fire use a bucket with sand, not a state-of-the-art fire extinguisher.