I just crashed and burned in a job interview on a binary tree question. I couldn't understand the interviewer (phone only, no video, no leetcode, and double non-native speakers). I wanted to look up the correct answer to the question afterwards, but with what little I remember I can't find the question in the usual collections of interview questions.
The core of the question was "under what circumstances would you not use recursion?". He went only describing how he would iterate through the right side(s) of the tree. Apparently that was different from the left side(s). He didn't say what the iteration is supposed to achieve. I really didn't get what he wanted from me.
I have a feeling that the answer includes "when the compiler does not support tail recursion", but as I said, I find no such question.
Does this ring a bell with anybody?
The core of the question was "under what circumstances would you not use recursion?". He went only describing how he would iterate through the right side(s) of the tree. Apparently that was different from the left side(s). He didn't say what the iteration is supposed to achieve. I really didn't get what he wanted from me.
I have a feeling that the answer includes "when the compiler does not support tail recursion", but as I said, I find no such question.
Does this ring a bell with anybody?