I was contacted by a recruiter, I came onsite for an initial screen.
I thought the interviewer was very nice, and the question was reasonable. However, the frustrating part for me was that for the given question, there were a few different ways to solve it.
From my perspective, it seemed that the approach I used to solve the question was not what the interviewer had in mind. I understand that you should listen to an interviewer when they interrupt you or give you hints, but to me it seemed like the "hints" were basically from the perspective of "you're not solving this the way I would solve it, even though both of our solutions are O(n)".
The result was that I was basically having to write out a problem on a white board and constantly have my train of thought interrupted. The interruptions were unnecessary, and I had to clarify to the interviewer that my intent would indeed work. Example interruption:
Interviewer: "That array index is giving you the same result as the other value"
Me: "No, that's a different variable name"
Interviewer: "Oh, oops. Continue"
or
Interviewer: "Wait, why are you replacing the for loop with a while loop?"
Me: "Because I want to be able to manipulate the cursor directly"
Interviewer: "Oh, ok. Continue"
In the above statement, it's clear that the usual method of solving the problem did not involve a while loop (but it could be done to solve the problem). After my solution, the interviewer explained the most straightforward solution to the problem which basically leveraged the constraints of the problem itself, and after seeing that then of course the problem was trivial to implement.
So to me, it seemed like the question was more of a riddle than a coding exercise, which I believe to be a bad interview question, and at my current company it's accepted as the WORST type of interview question.
It was rather embarrassing for me to be turned down, especially on just the initial screen, but another qualm I had was that screens are generally meant to filter out candidates that can't code at all, not candidates who are questionable in their skills (from my perspective my skills aren't questionable, but clearly I did not give my best performance in this screen).
To me it felt as though the interviewer in this case did not have much experience. While I was answering the questions that were given to me, I was having to explain a few quirks to the python language that the interviewer clearly did not know i.e. "Oh, I didn't know you could compare dictionaries like that". For that to be said, I can only infer that the ONLY thing this interviewer was looking for is if I answer the question that was given to me in the exact way they wanted it solved.