this post was submitted on 08 Apr 2025
734 points (98.4% liked)

Programmer Humor

22349 readers
3289 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
all 43 comments
sorted by: hot top controversial new old
[–] latenightnoir@lemmy.blahaj.zone 82 points 5 days ago (1 children)

Having to hold interviews was the worst part of the job, by far... Brings about a certain kind of guilt, to sit there and try to sell battery acid as ice-cold lemonade.

[–] adrian@50501.chat 41 points 5 days ago (2 children)

Debugging interviews are great, because it really allows you to see how someone thinks. You give them a working test and some buggy code, then ask them to debug it and take as much time as they need while you look over your shoulder (virtually). IDC what the methodology is or the time it takes, if you can solve logic puzzles, you'll make a decent programmer.

[–] frezik@midwest.social 10 points 4 days ago* (last edited 4 days ago)

if you can solve logic puzzles, you’ll make a decent programmer.

I mean, that's what Google did several years ago. They stopped because data showed it didn't mean anything.

That said, debugging existing code is a more realistic test of what you'll be doing on any programming job, as opposed to writing anything from scratch.

Oh, I didn't mean the content, I meant the purpose of it. In my experience, it wasn't just about testing the interviewees, it implies having to 'sell' the company as well, to give the interviewees reasons to want to be hired. That's the bit which generated the guilt.

[–] mac@lemm.ee 38 points 4 days ago* (last edited 4 days ago) (3 children)

Yeah I need to find a new job soon, like things are going Bad at the company and it's not looking good for anyone.

I've wanted to find a new job for well over 6 months, but I just don't have it in me to study after work or on the weekends.

Its like I've got burn out handcuffs or something.

[–] 0x0@lemmy.zip 6 points 4 days ago

Try posting on mastodon with #fedihire, it'll get boosted, maybe it'll help.

[–] Maganra@lemmy.dbzer0.com 6 points 4 days ago

I feel that...

[–] calcopiritus@lemmy.world 1 points 4 days ago (2 children)

Do they ask to implement quick sort to people with job experience? I thought they only did that to juniors.

[–] beveradb@lemm.ee 2 points 3 days ago

Leetcode is a plague with a sales team

[–] mac@lemm.ee 3 points 4 days ago

Im at 3.5YoE, and have gotten LC for all of my interviews

[–] danc4498@lemmy.world 42 points 5 days ago (4 children)

Maybe it’s like teaching kids the quadratic equation; where it’s less about learning the thing and more about understanding how to problem solve and use logic.

In this case maybe the point is to show an understanding of algorithms and that you can explain them out loud.

[–] magic_lobster_party@fedia.io 45 points 5 days ago (2 children)

The quadratic equation is the basis for most other math and physics. It’s used all the time.

The good thing about quicksort is that it’s a good demonstration of an O(n log n) algorithm, and that’s about it.

"The basis for most other math and physics" they do a complete fucksewage job at demonstrating that in school. I remember several years in math class "And here's the quadratic equation, the one that's all over 2a" and it was an exercise in plugging and chugging.

Math is a useful, powerful and allegedly beautiful thing. it's such a shame it's illegal to teach it competently.

[–] Kidplayer_666@lemm.ee 11 points 5 days ago (1 children)

If I’m not mistaken, quick sort is worst case O(n^2), merge sort is what actually achieves O(nlogn), the point is that quicksort is on average more memory (and time?) efficient

[–] magic_lobster_party@fedia.io 7 points 4 days ago (1 children)

Maybe.

When using a random pivot, the worst case becomes exponentially more unlikely the larger the n. The O notation only cares about the complexity when n approaches infinity. So when n approaches infinity, the likelihood of O(n^2) performance approaches 0 (and the likelihood of O(n log n) approaches 1).

I think it’s fine to call it O(n log n).

[–] MBM 4 points 4 days ago

That's when you add a w.h.p. (with high probability)

[–] shortrounddev@lemmy.world 21 points 5 days ago (3 children)

If it's about problem solving and using logic, why do we need to memorize quicksort? That's not an example of using logic or problem solving

[–] xigoi@lemmy.sdf.org 8 points 4 days ago* (last edited 4 days ago) (2 children)

You don’t need to memorize quicksort. If you understand how it works, it’s trivial to work out the exact details.

[–] skisnow@lemmy.ca 3 points 3 days ago

Thank you.

"I don't have to know CS201 Data Structures and Algorithms to do my job", says a thousand D-tier coders online, whose code is costing their employers a small fortune in unnecessary cloud compute bills because they just blindly imported a ton of python libraries and went with the least suitable data structures and algorithms for the task at hand, because that's what the defaults were for that library. "It fulfils all the requirements from the client perfectly, bow to my experience and skill in delivering customer value".

It's classic Dunning-Kruger, incompetent people who are too incompetent to know they're incompetent.

Bonus points when they cite the fact that they were involved with a project that cost a hundred million dollars, as "proof" that they're a world-class expert, when it probably would have been a ten million dollar project with an actually competent engineer...

[–] sus@programming.dev 2 points 4 days ago (2 children)

you can also 'trivially' derive the quadratic formula using completing the square, but does anybody actually do that instead of just memorizing the formula?

[–] xigoi@lemmy.sdf.org 2 points 3 days ago

That depends on how often you use it. If I needed to write quicksort as often as the quadratic formula, I’d probably remember it. And if I only used the quadratic formula as often as I do quicksort, I’d just derive it each time.

[–] furikuri@programming.dev 2 points 3 days ago

Honestly, for the first year or two after learning about it (which is the only time where it's really relevant) that's exactly what I did. Spend 30 seconds, derive something that's definitely correct, and never worry again about your memory randomly failing you

[–] sus@programming.dev 14 points 4 days ago* (last edited 4 days ago)

it's actually about testing your ability and willingness to jump through hoops that serve no discernible purpose, one of the most vital skills for working within 99% of human organizations

[–] danc4498@lemmy.world 5 points 5 days ago (1 children)

I meant that as 2 separate thoughts. The quick sort is about understanding algorithms and ability to communicate them.

[–] shortrounddev@lemmy.world 2 points 5 days ago

"how to problem solve" and "use logic" are, I believe, myths. When you teach someone to implement quicksort, all you've done is taught them to implement quicksort. Classroom based lectures and rote memorization do not impart any kind of broader "problem-solving" ability. This is an ex post rationalization by the perpetrators of the education system to justify their own existence. I place the value of what they do very low

[–] frezik@midwest.social 11 points 5 days ago (1 children)

If it were a question about the tradeoffs of different sort algorithms and how they might apply to a given problem, I would agree. That's not what these interview questions are about.

[–] danc4498@lemmy.world 6 points 5 days ago (2 children)

Maybe it’s about being able to communicate an algorithm verbally. Unless these are written interviews, then yeah, probably pointless.

Also, I do think being able to understand how an algorithm works is probably important on its own.

[–] qarbone@lemmy.world 9 points 5 days ago (1 children)

Then give them some code and tell them to explain it. Having testees regurgitate algorithm implementations from memory is just testing rote memory.

I thought we had all lived through terrible public schools that just tested memory, and resolved to do better.

[–] BombOmOm@lemmy.world 2 points 4 days ago* (last edited 4 days ago)

Yeah, it's a solved problem. I'm going to call the library's default sort and move on. If it somehow is a problem, I'll revisit later.

Now, optimizing database calls, fixing (and avoiding!) security holes, writing tests that don't take forever to run, writing functions so they can be easily re-used later, and not duplicating code. Now there are some skills!

"It's faster if we make a duplicate of this function and change this section, then we can move onto other things"

"No it's much slower, because your code review just came back telling you to throw that idea in the garbage and do it right"

[–] frezik@midwest.social 1 points 5 days ago

There's a lot of ways to test communication skills. This doesn't seem like a very good one.

[–] vane@lemmy.world 4 points 3 days ago* (last edited 3 days ago) (1 children)

Honestly when I was doing interview I always tried to ask simple questions about data structures or technologies from CV like what's the difference between array / list and set, or set and map, I got 90% people failing those answers, sometimes it was stress and you could feel it, so I even helped them with answers and always tried to encourage them so they get rid of stress and start thinking. All of people I hired turned out to be good workers and still work in those companies. I think we just slowly forget how to talk with each other. With all the technology around us, we're losing empathy.

[–] derpgon@programming.dev 2 points 2 days ago (1 children)

Hell ask me what is the difference between a class and an interface and it would be hard for me to put into theory as well. The only reason I remember the correct answer is because I remember being confused.

If I do strictly my point of view, I am so bad with theory, and I usually don't think about how to write shit - I just do. I don't know how the ORM works inside, I just know how to use it, and most caveats are just hard coded in my brain.

So I failed the theoretical interviews in most companies, but those who hired me never kicked me out themselves (as I am a contractor me and rest of the team was part of yearly layoffs, in three companies, but it was purely because money / mergers / conversion to employees).

[–] vane@lemmy.world 2 points 2 days ago

I don't think good job interview is about answering right or wrong questions. It's more about talking with human you could work with and if that human is able to think his way out because it's engineering job after all.

I am contractor as well I only did job interviews as a side quest and I also frequently fail my job interviews, there is nothing bad there.

Personally I didn't like 90% of job interviews and there were plenty of them. Most of those people tried to convince me they are smarter and better then me and I am lucky I am speaking with them. But unfortunatelly that's how it looks like.

Most people that excpect right or wrong answers are just morons in my opinion because programming is about being wrong 90% of the time.

Good Luck

[–] TheGiantKorean@lemmy.world 24 points 4 days ago (2 children)

We don't ask this sort of shit during our interviews.

[–] OmgItBurns@discuss.online 14 points 4 days ago

Honestly, I just ask if they can solve FizzBuzz. It shows me how they approach problems, how they communicate their process, and that they know basic programming concepts. The rest of the interview just kinda tells me if I'd get along with them as a person. Most other things, good and bad, only show up over time.

Then again, I work with software that isn't exceptionally complex.

[–] Agent641@lemmy.world 11 points 4 days ago (2 children)

You ask other, equally inane shit?

[–] TheGiantKorean@lemmy.world 15 points 4 days ago
[–] wewbull@feddit.uk 4 points 4 days ago

I ask them how they'd do the job we're recruiting for, on a simplified example project.

One this morning admitted she had the wrong preconceptions about the role, but understood exactly why we were asking what we were asking.

I call that success.

[–] Hupf@feddit.org 3 points 3 days ago

You must prove yourself by reciting the holy incantation flawlessly if you want to become a member of our order.

[–] PieMePlenty@lemmy.world 8 points 4 days ago* (last edited 4 days ago)

Been coding for 10 years. Wouldnt know how without looking up the rules for quicksort. Guess they want programmers fresh out of college or highschool then and I dodged a bullet?

[–] WolfLink@sh.itjust.works 2 points 3 days ago (1 children)

For the most part it’s best to use system provided sorting implementations, but somebody has to write those implementations, so every once in a while somebody needs to do it (in practice by looking up a reference implementation of course).

But also it’s good to understand things like big O scaling and why we use quicksort rather than a naive insertion sort and when to use quick sort vs merge sort or some other form of stable sort.

[–] Acters@lemmy.world 1 points 3 days ago* (last edited 3 days ago)

Glibc's qsort will default to either insertion sort mergesort or heapsort. Quicksort itself is used when it cannot allocate extra memory for mergesort or heapsort. Insertion sort is still used in the quicksort code, when there is a final 4 items that need to be sorted.

Normally it is simply mergesort or heapsort. Why I know this? Because there was a recent CVE for quicksort and to reproduce the bug I had to force memory to be unable to be allocated with a max size item. It was interesting reading the source code.

That is if you are not on a recent version of qsort which simply removed quicksort altogether for the mergesort + heapsort

Older version still had quicksort and even some had insertion sort. Its interesting to look at all the different versions of qsort.