Tech IndustryFeb 9, 2023
NewKfX0p

Is it normal for an interviewer to ask you a coding question they do not know the answer to themself?

I recently had a tech screen at G and it was an interesting experience. The interviewer asked me a question they had not thoroughly reviewed or were familiar with prior to the interview. At the start of the interview, they pasted the question into the shared document and read it out loud. I asked a clarifying question, and the interviewer took a few minutes to answer after some hesitation. I found it a bit strange but thought maybe it had been a while since they conducted an interview. After a few minutes, I realized that the optimal solution to the problem required using a monotonic stack. Before beginning to code, I confirmed my approach and stated, "I think I can solve this in linear time using a monotonic stack". The interviewer then asked what a monotonic stack was, causing me to question myself, as I thought if the interviewer didn't know what it was, it must not be in the official solution to the problem. However, about 10 seconds later, the interviewer said, "Oh, sure, you can use a monotonic stack" (after they had reviewed the solution). After I coded it up, the interviewer noticed the nested while loop used to maintain the monotonic stack and said, "That's not linear time, you have a nested loop". I then had to prove that the worst-case scenario was O(n * 2), which of course is still considered linear time and reduces to O(n) in big-O notation. The interviewer still seemed confused, making the situation a bit awkward. I understand why they were confused, as a monotonic stack can be difficult to understand at first if one has never encountered it. What was strange to me was that the interviewer asked a question they themselves did not know the answer to or at least the optimal solution to. The interviewer concluded the coding portion of the interview and we talked for about 5 minutes before the time was up. The interviewer seemed like a cool person, and we had a good connection, so I am hoping I still pass (fortunately they did not seem to have an ego). After the interview, I thought maybe there was another way to solve the problem in linear time that the interviewer was expecting and I didn't consider. I did some research and found the problem on LC (a different "story" but the same problem at its core). It turns out that using a monotonic stack was the only way to solve the problem in linear time. am I overthinking this or is it strange for an interviewer to ask a coding question they don't know the answer to? tldr: My Google interviewer for my tech screen asked me a question they did not know the answer to. Is that normal? TC: 120k, 4 yoe #google

Visa Dyude Feb 9, 2023

Nope

Lyft gtvbgd Feb 9, 2023

They were just ill prepared. The interviewers select a question from a list and it’s up to them to prepare the interview. It seems like in your case your interviewer showed up without having understood the question s/he was asking you. I’ve done this myself when I simply forgot I had an interview to prepare for, and I just winged it on the phone. If you solved it, you passed.

Uber Abysswlkr Feb 9, 2023

I think that is crazy, definitely dropped the ball as an interviewer

Zscaler kdIz55 Feb 9, 2023

They r on the other side. They have a lot of leeway. You cannot assume anything either though. What if they were pretending just to see how you would react if you sensed ignorance from the other side ?

New
KfX0p OP Feb 9, 2023

Interesting point but I highly doubt that because they were hemming and hawing while reading the solution during the entire interview.

Google blindly__ Feb 9, 2023

Yeah sounds like they didn't fully understand the question. Just guessing, I'd say they saw the problem somewhere, thought of some other solution and figured that's what candidates would do, and used it for an interview. And your solution was new to them. Sorry about that, happens sometimes.

L3Harris Technologies gieo1 Feb 9, 2023

Trapping rain water? Largest rect Histogram? Either case, incompetent interviewer