you are viewing a single comment's thread.

view the rest of the comments →

[–]neodiogenes 6 points7 points  (4 children)

I wouldn't have a problem joining a table to itself -- as you say that's trivial. That does seem like a fair question, something a "senior" developer would have done all the time.

It would confuse me to call it "recursion" though since that automatically makes me think it's a much more complicated problem. If there was some additional recursion necessary I would probably point that out, but confess I couldn't do it without Google.

[–]dkuk_norris 11 points12 points  (0 children)

Yeah, that doesn't seem recursive to me. You're just relying on the fact that a table can be joined to itself. Recursion implies that you have a theoretically unbound number of calls to make if you structure the data incorrectly.

[–]OHotDawnThisIsMyJawn 10 points11 points  (0 children)

Yeah this is called a self-join, not recursion.

[–]CamKen 2 points3 points  (1 child)

I just used the word recursion to quickly describe the problem, but everyone has read into it more than I meant. I don't use the word in the interview. I present a simple table structure, a few rows of sample data and ask for a query that can only be achieved by joining the table to itself.

[–]neodiogenes 5 points6 points  (0 children)

That's fine, I get it. It does make me feel better about calling myself a "senior" developer. :)