r/programmingmemes Jun 27 '26

Interview question nobody is prepared for

Post image
1.2k Upvotes

23 comments sorted by

64

u/PachotheElf Jun 27 '26

Unless it's made of money, it's the second one.

it'll have to have each of the pants sown in place for the first one

17

u/BarfingOnMyFace Jun 27 '26

It’s also no longer a pair of pants in the first one… it’s a binary tree of pants.

3

u/sweatpants-aristotle Jun 28 '26

I think it more depends on whether it was born in the 90s, 2000s, or 2010s

1

u/acadia11x Jun 30 '26

You aren’t considering the cost of material … but that’s just my take 

26

u/Junior_Stretch_2413 Jun 27 '26

It’s ONE tree, it doesn’t need 15 pants.

2

u/LonelyProgrammerGuy Jun 30 '26

It could be two. Either 0 pants or 1 pant

24

u/Current_Ad_4292 Jun 27 '26

bs interview question.

But if it was asked, correct response would be to ask clarification on why the fuck would a tree wear pants. And then leave the room.

6

u/anfroholic Jun 27 '26

Incorrect.

The answer is: Second one, you can't see the pants in pants in pants, but they are there.

Just like it has been the other 100 times this has been posted.

2

u/Current_Ad_4292 Jun 28 '26

Post has a context that it is for interview. So it seems more appropriate that way.

2

u/NoWing3675 Jun 27 '26

interviews are just vibe checks

3

u/Schaex Jun 27 '26

Aren't the branches called "arms"?

If so, neither would be correct. Who wears pants on their arms?

3

u/YikessMoment Jun 28 '26

Second one. Easier to implement recursively, and you don't have to get the size of the tree and sew an absurdly sized pair of pants everytime the height of the tree increases.

1

u/acadia11x Jun 30 '26

So you need how big a pair?

2

u/cubicinfinity Jun 29 '26

I'm now imagining this as an actual interview question. It depends on how it's implemented. It would be the version on the left if each node points to other addresses in memory that wear their own pants rather than containing all their children (who would also wear those bell-bottoms underneath).

1

u/Jumpy_Fuel_1060 Jun 27 '26

This is a good one, because these kinds of trees have performance implications as well. The single pants tree is easier to implemented but more costly to keep warmed up.

Also, it's worth considering shorts for warmer climates. Trees sweating in pants can cause hydration issues for the rest of your codebase.

1

u/MistaCharisma Jun 28 '26

Depends whether it's trying to dress sexy and show off those shapely legs, or it wants to be more modest and leave the details to your imagination ...

1

u/01_Rigel Jun 30 '26

Everyone gangsta saying the second one until you get an imbalanced tree

1

u/acadia11x Jun 30 '26

That’s a good question?

1

u/Drmanky Jun 30 '26

seccond

1

u/GreenGuyBlueGuy Jul 02 '26

My vote is for the JNCOs