Live data from Hacker News

Programmers can’t write algorithms without help

queworx.com

31–40 of 105 posts

Re: Programmers can’t write algorithms without help

#31
post #6

Yet another article showcasing how the tech interview process is fundamentally flawed. Personal anecdote: I recently underwent an interview process for a position in my field of expertise (computer vision) consisting of multiple in-person stages, whiteboard coding, product design and a take-home assignment that required developing a foundational (bubble-sort like) algorithm from scratch. After successfully completing…

It's very weird how some of those tech interviews are done. I've luckily never had to do one of those, but from the YouTube videos of training interviews and example interviews, almost everyone seems to be asked to implement a slight variation on something to be found in a Data Structures & Problem Solving book by Weiss. Great if that is what you'll be doing all day, but regurgitating some way to get the smallest num…

So everyone knows that the interview isn't perfectly realistic--it's a simulation.

Consider that when athletes are scouted, they are usually not asked to play in a full game of their sport. But instead certain stats like 'how fast can he run 100m' and 'how high can he jump' are used.

Sure, in a real game you will never run 100m in a straight line on asphalt--but the speed at which one runs 100m in a straight line is a good proxy for how fast one can maneuver during real play.

Re: Programmers can’t write algorithms without help

#32
post #27

Earlier quoted context omitted.

I get your point, but why would you pick bubble sort? That’s one any engineer should be able to implement without any help. It’s the more complex/useful ones worth discussing. Even Obama knows this: https://m.youtube.com/watch?v=k4RRi_ntQc8

> That’s one any engineer should be able to implement without any help. If I wrote it down every time someone claims that "this is so important any engineer should know it," I'd have a book as thick as the bible full of trivia. All of it so easy, and yet in every position you can find a person who hasn't mastered it all. Maybe it isn't all that important after all. Most of these people are capable of finding help sho…

I’m not saying that it’s important, I’m saying it’s trivial and an engineer should be able to figure it out. Bubble sort that is.

Merge sort? Quick sort? Bogosort? Maybe not. But bubble sort yes.

Just like an engineer even at the most junior level should be able to swap and write fizz buzz. If you can’t do that you certainly cannot call yourself an engineer.

Re: Programmers can’t write algorithms without help

#33

Earlier quoted context omitted.

I picked bubble sort, because it's literally the example from the first sentence of the article: > David Hansson, the creator of Ruby on Rails, admitted in a tweet that he wouldn’t be able to write bubble sort on a whiteboard.

Oh my, I’m that guy today. Whoever said it, I have a super hard time believing DHH couldn’t implement bubble sort on a whiteboard. Am I the only one? I get that people hate whiteboard/algorithm interviews, but bubble sort? for i = 0..n: for j = i..n: if arr[i] > arr[j]: arr[j], arr[i] = arr[i], arr[j] Everyone in this field should be able to do this, maybe not right away, maybe not without bugs, but with help within…

Yeah, this is barely a step above fizzbuzz.

If you can't do that without help in 45 minutes, what can you actually do?

I think the actual problem is most developers / programmers are just bad at the job, and then go in a huff when this is pointed out.

Re: Programmers can’t write algorithms without help

#34
The tech lead who doesn't know `len()` but claims to know Python? Yes, they're incompetent. It's okay; it's a common problem in our industry, and easily remedied by study and practice.

Chinese is not a great example. Native speakers have trouble reading and writing their own language; it is so complicated that people cannot remember how to write commonly-spoken words or how to read. [0][1] (Choice moment from [1] is when a university student says that Chinese literacy is as difficult as English!)

Perhaps we can do better as a community to design better languages, but also we should not condone people claiming that they know the languages when they clearly don't. Yes, Python could be easier; no, Python is not that hard.

[0] https://www.youtube.com/watch?v=HQh1_zyig1M

[1] https://www.youtube.com/watch?v=zxHskrqMqII

Re: Programmers can’t write algorithms without help

#35
post #2

> Programmers can’t write algorithms without help And that might be a good thing. How often does a normal software engineer have to write bubble sort from scratch in his daily life? If someone from my team came to me telling me he had to sort an array and wrote bubble sort from scratch, then I'd probably not be very happy with that unless there is a really good reason to spend that time on it rather than using an exi…

I was once asked to sort a singly linked list in an interview, and the bubble sort was the only one I could think of at the time. This was a small part of a larger coding test that I think was based on a problem they actually ran into, which a previous employee had solved badly. I got a low-ball offer and turned it down. It wasn't until a couple of years later that I thought about that problem again and realized a merge sort would have been perfect.

Re: Programmers can’t write algorithms without help

#36
post #31

Earlier quoted context omitted.

It's very weird how some of those tech interviews are done. I've luckily never had to do one of those, but from the YouTube videos of training interviews and example interviews, almost everyone seems to be asked to implement a slight variation on something to be found in a Data Structures & Problem Solving book by Weiss. Great if that is what you'll be doing all day, but regurgitating some way to get the smallest num…

So everyone knows that the interview isn't perfectly realistic--it's a simulation. Consider that when athletes are scouted, they are usually not asked to play in a full game of their sport. But instead certain stats like 'how fast can he run 100m' and 'how high can he jump' are used. Sure, in a real game you will never run 100m in a straight line on asphalt--but the speed at which one runs 100m in a straight line is…

That's not a very good example. Athletes are being watched for 4-8 years before they are ever drafted. Colleges are watching all the high school games, and Pros are watching all the college games.

Re: Programmers can’t write algorithms without help

#37
post #26
post #2

> Programmers can’t write algorithms without help And that might be a good thing. How often does a normal software engineer have to write bubble sort from scratch in his daily life? If someone from my team came to me telling me he had to sort an array and wrote bubble sort from scratch, then I'd probably not be very happy with that unless there is a really good reason to spend that time on it rather than using an exi…

I've been a developer for almost 2 years (I know not that long) but I have never even heard of bubble sort. Looking it up, it is O(n^2). Is there a reason this is a common interview question? It doesn't seem like a sort one would ever really use, or at least it has very obscure uses. I always thought merge/quick sorts accounted for 99.9% of use cases and only ever really learned about those.

I think it's just the simplest sort to describe/implement on a whiteboard.

Re: Programmers can’t write algorithms without help

#38
post #26
post #2

> Programmers can’t write algorithms without help And that might be a good thing. How often does a normal software engineer have to write bubble sort from scratch in his daily life? If someone from my team came to me telling me he had to sort an array and wrote bubble sort from scratch, then I'd probably not be very happy with that unless there is a really good reason to spend that time on it rather than using an exi…

I've been a developer for almost 2 years (I know not that long) but I have never even heard of bubble sort. Looking it up, it is O(n^2). Is there a reason this is a common interview question? It doesn't seem like a sort one would ever really use, or at least it has very obscure uses. I always thought merge/quick sorts accounted for 99.9% of use cases and only ever really learned about those.

The logic of bubble sort is so simple that just the description is enough for an implementation. It's a common interview question for the same reason Fizzbuzz is used -- any programmer worth their salt should be able to just write it down.

Insertion and selection sort are also O(N^2), but sorts like merge and quick will use them to sort small sublists in their recursive cases because they are fast when input is small enough.

Re: Programmers can’t write algorithms without help

#39
post #31

Earlier quoted context omitted.

It's very weird how some of those tech interviews are done. I've luckily never had to do one of those, but from the YouTube videos of training interviews and example interviews, almost everyone seems to be asked to implement a slight variation on something to be found in a Data Structures & Problem Solving book by Weiss. Great if that is what you'll be doing all day, but regurgitating some way to get the smallest num…

So everyone knows that the interview isn't perfectly realistic--it's a simulation. Consider that when athletes are scouted, they are usually not asked to play in a full game of their sport. But instead certain stats like 'how fast can he run 100m' and 'how high can he jump' are used. Sure, in a real game you will never run 100m in a straight line on asphalt--but the speed at which one runs 100m in a straight line is…

For almost any sport this is a spectacularly bad metric. Just because it can be measured doesn’t make it meaningful. FWIW, the “fitness” required for sportspersons is a very sport-dependent diffuse constellation of factors.

Re: Programmers can’t write algorithms without help

#40
post #6

Yet another article showcasing how the tech interview process is fundamentally flawed. Personal anecdote: I recently underwent an interview process for a position in my field of expertise (computer vision) consisting of multiple in-person stages, whiteboard coding, product design and a take-home assignment that required developing a foundational (bubble-sort like) algorithm from scratch. After successfully completing…

Did you try asking about comp before interviewing though? I usually do and most of the time you get a reasonable answer. Probably depends on how easy it would be for them to estimate your own comp though
Post reply on HN