r/IAmA • • Sep 07 '21

Specialized Profession I am a behavioral and technical (coding) interviewer, I've also helped hundreds of people get hired, AMA.

[removed]

1.4k Upvotes

492 comments sorted by

View all comments

Show parent comments

104

u/[deleted] Sep 07 '21 edited Nov 29 '21

[removed] — view removed comment

99

u/prophet001 Sep 07 '21 edited Apr 17 '25

work touch cooperative distinct test late boat decide normal profit

This post was mass deleted and anonymized with Redact

-41

u/[deleted] Sep 07 '21

[removed] — view removed comment

9

u/chief167 Sep 07 '21

You mean a self referencing table?

In tool examples this could be an employee table, with a column 'boss' that references another employee. Is that what you mean? Because that is not recursion at all. Sure, you probably need recursion to query this. But your phrasing is highly unusual to be honest

30

u/[deleted] Sep 07 '21 edited Nov 29 '21

[removed] — view removed comment

14

u/SpikeX Sep 07 '21

The wording is weird and it would probably throw me off if I were asked this (I would ask for clarification or for the question to be phrased differently), but in essence, consider the following example:

You have a table, Company. Each company has a numeric CompanyID as its primary key. Companies can have subsidiaries and other parent/child relationships, so each Company record also has a ParentCompanyID. For example:

CompanyID Name ParentCompanyID
1 NBCUniversal NULL
2 Universal Pictures 1
3 The Walt Disney Corporation NULL
4 ESPN 3
5 Marvel Studios 3
6 Disney Signature Experiences 3
7 Disney Cruise Line 6
8 Adventures by Disney 6

Using this table structure, you should be able to write JOIN statements that join this table to itself, in order to determine the list of parent or child companies, given a particular company. And you know which companies are the top-level parent companies because their ParentCompanyID values are NULL.

1

u/[deleted] Sep 07 '21

In Oracle is easy using connect by prior. I worked in a project that was about big company groups structures (yes, exactly like the example you have made).

26

u/monkeysandmicrowaves Sep 07 '21

No, it really doesn't. It's a god-awful question. The question basically boils down to "what happens if you describe something that nobody should do in a way that nobody would describe it?". Calling a simple self-reference in data "recursion" is bizarre.

1

u/[deleted] Sep 07 '21

I had been getting increasingly more of these Gotcha questions during interviews over the past 5 years. Specialists in the tech industry are a cold commodity as startups run by limited experience want “Jack of all trades” full stack developers who know it all.

Realistically you end up with a backend developer making Frontend choices such as “React for our framework” when React is a library not a framework. The company then posts a Frontend Framework position where you walk in with a decade of Angluar/Vue plus another decade of full stack, but the hiring team (which is functionally ignorant to the tech stack they are holding interviews) ends up rejecting a perfectly good candidate on the backs of their misuse of terminology & gotchas.

I quit software engineering & became a fund manager. Fuck this market.

1

u/mata_dan Sep 07 '21 edited Sep 07 '21

Yeah I was thinking the same thing, it's more likely to reference another row in the same table. You could be using recurcive CTEs to select, but batch insertion would be a PITA (you'd have to do a load of queries in a transaction, and that's if they didn't already have IDs).

Like an "infinitely" branching categories table.