I agree with the first paragraph of the answer Zealint, but strongly disagree neither with the second paragraph, nor, especially with the conclusions.
As my personal practice shows in life and real projects, the need for this is very low, more often foreach
Well, that's exactly what the employer wants to find out; understanding the fact that cycle and recursion are two completely different algorithms with different fields of use; and experience in solving problems for which recursion is required.
Although I personally would not ask to write a recursion code at the interview, but I would give two tasks to bypass the tree, one of which is solved by a cycle and the second by recursion, and I would just ask how the applicant would solve each. Just to cut off those familiar with recursion by hearsay, who would use it to find a parent.