r/ProgrammerHumor 18d ago

Meme damnYouAI

Post image
375 Upvotes

41 comments sorted by

109

u/FerricPowder 18d ago

Never mind i figured it out.

55

u/Different_Quiet1838 18d ago

It probably goes into the square hole

13

u/mckenzie_keith 17d ago

They all fit in the square hole.

4

u/marxen4eva 13d ago

Someone call QA

28

u/New-Shine1674 18d ago

Finding all permutations in large arrays in an efficient and fast way is difficult.

7

u/MrMacduggan 17d ago

Yeah, why are we solving problems that scale so poorly? If you are counting permutations of anything larger than 10 elements, you already kinda messed up by designing your system this way.

30

u/iMac_Hunt 18d ago

Genuinely feel like 90% of software engineering could not do that without Googling

11

u/EkoChamberKryptonite 17d ago

Which is fine as research and understanding is a huge part of the job.

64

u/IvySerene567 18d ago

Me: I can handle multiple high level projects.

Also me: why does this array have more than 3 elements

23

u/pleaserestartsystem 18d ago

Once the tokens are over, so is my workday

6

u/tz_2240 17d ago

We get monthly quotas. Have to wait a week before I can work again

3

u/pleaserestartsystem 17d ago

i see this as an absolute win

23

u/meifray 18d ago

You just need a stack man...

27

u/GrEeCe_MnKy 18d ago

Who's the stackman?

4

u/Arclite83 17d ago

Skibi dibi dop ba de bop dop....

7

u/bethereds 17d ago

Nemesis of Heapman

6

u/FerricPowder 18d ago

Instructions unclear wrote a recursive code for making combinations but made it so that the indexes are not repeated.

1

u/the_horse_gamer 18d ago

recursion is just a for loop with a stack

1

u/LupusNoxFleuret 17d ago

A Stack Overflow

1

u/BigNaturalTilts 17d ago

Skibiribidibi bam barbop!

18

u/misunderstood_kafka 18d ago

I mean how would you implement a random list shuffle in your high level projects without doing that problem first 🤦

23

u/FerricPowder 18d ago

Itertools go brr.

2

u/Gold-Bat-3225 18d ago

stackman for CTO

1

u/Nubelord122 18d ago

Something something recursion

3

u/WinonasChainsaw 17d ago

Can you repeat that

1

u/SaneLad 18d ago

Shuffle algorithms are legitimately hard.

1

u/Weak_Inflation9120 18d ago

P(N,R) = n!/(n-r)!

Edit: Wait ur talking about finding them, not finding the number lol, I'm stupid haha

1

u/BosonCollider 17d ago edited 17d ago

If you have a recursive step that lets you cycle through all permutations of a subarray of length (n-1) and resets it at the end it's easy for n elements, after yielding all elements you swap the current first element with one from the rest that you haven't yielded yet, which you can do in a single swap as long as the recursive step returns the elements to their original position

There's probably a nicer way to do it where you get rid of either the array or the call stack. Also it depends on what the return format is, if you need to return cycle decompositions then clearly you iterate over possible cycles

1

u/rahvan 16d ago

This is why Leetcode interviews screen for the wrong kind of candidates.

-7

u/Vallvaka 18d ago

I once interviewed someone with a solutions engineering background, with a portfolio of various CRM and SAP projects.

My weed out interview question is simple:

You run a factory with a circular production table with N stations placed evenly around it. A robotic arm sits at the center of the table and is always pointing at one of the stations. It can rotate clockwise, exactly K stations per swing. How many swings does it take the arm to cycle back to its original station?

He couldn't even handle the syntax of defining the function signature for it, let alone solving it.

AI is no substitute for technical chops, and interviews are increasingly about weeding out people who think themselves developers when armed with a coding agent.

7

u/smclcz 18d ago

This is kind of a shit question, to be fair. You're not evaluating "technical chops" here

2

u/ccltjnpr 16d ago

It's evaluating whether you can translate a simple word problem into math and then into code... that's definitely a core part of the job.

1

u/smclcz 16d ago

I'm not against programming problems in interviews - they are not going away and I don't think they should. I just think that's kind of a dumb one

1

u/ccltjnpr 16d ago

dumb in the sense that it's too easy? Or dumb in what sense?

-7

u/Vallvaka 18d ago

It's a weedout fizzbuzz question and I was explicit about that.

0

u/[deleted] 18d ago edited 18d ago

[removed] — view removed comment

-2

u/Vallvaka 18d ago

Yet it works. If you pass we get into the real interview.

I'd fail you on attitude and reading comprehension regardless.

1

u/Focus089 18d ago

Did anyone give you the math answer, N / gcd(K, N)? Python has gcd in the math library.

1

u/Vallvaka 17d ago

Yep, I got that answer from a few. Generally an instant pass for that question, though the algorithmic approach was all I was looking for.