
Programmers can’t write algorithms without help - cryo8822
http://www.queworx.com/2019/11/04/programmers-cant-write-algorithms-without-help-again-about-the-interview-again/
======
glitchc
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 all of these hurdles, I ended up with a low-ball
offer targeting entry-level candidates. If we could have discussed the
compensation up front, I wouldn’t even have bothered.

~~~
oneplane
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 number in a list or making a directed graph for a
word morphing joke hardly represents anything other than a persons skill to
repeat what someone else did and wrote down decades ago.

~~~
Gunax
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.

~~~
sithlord
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.

~~~
Gunax
Perhaps--but it's the analogy I came up with while writing this comment. If
you can replace it with a better one, go ahead.

Sometimes analogies are not really meant to be perfect, but just simpler
methods of communicating information.

------
starbugs
> 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 existing
solution.

~~~
Gunax
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.

~~~
cinnamonheart
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.

~~~
Gunax
I see. I would hope one would give a description of what bubble sort is during
the question.

It's definitely easy to implement, it just had me worried because I had never
heard of it!

------
commandlinefan
Whenever this comes up, I can only assume that people are talking about very
different sorts of technical interviews than I’ve ever been subject to. I’ve
been working as a programmer for 25 years now and must have been through at
least two dozen technical interviews in that time (one just a couple of years
ago) and I’ve never had this level of pedantry thrown at me. It sounds like
the poster has been rejected from a job interview for missing a semicolon or
writing “length” instead of “len”. Maybe I’ve just been lucky? I did once have
somebody ask me if I knew SQL - I said I did since I had written some queries
using it, but not much. He asked me what command was used to add data into a
database. I didn’t know (like I said, I knew the query syntax, but that was
about it). That seems to me to have been a very reasonable question to ask,
and a good, quick way to figure out that I didn’t really have much experience
with SQL.

~~~
delinquentme
Yes you're the exception.

Somehow we arent really adept at interviewing at what the day-to-day
requirements of a position.

Instead were much more interested in edge-case stuff like bubble sort.

I wonder if this is some assessment of "are they capable of substantially more
complex tasks, and if so, safe to assume they're capable of less-complex
minutiae.

Seems about right, as often these evaluation type things are proxies.

------
lidHanteyk
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](https://www.youtube.com/watch?v=HQh1_zyig1M)

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

~~~
Eleopteryx
>Yes, they're incompetent.

So you feel confident in asserting that, at the time that the person made that
tweet, the quality of the Python code that they shipped was poor, or it took
an inordinate amount of time to produce? All because they had to look up
len()?

~~~
commandlinefan
Actually, yeah. That one jumped out at me, too: that’s kind of like saying “I
know how to drive a car, but I always have to look up which one is the gas
pedal and which one is the brake”. If you’ve done _anything_ in Python, the
length function is ingrained in your brain, so if you honestly don’t remember
it, you just haven’t written any Python (or it’s been more than 10 years).

~~~
jcranmer
I routinely use several languages, and am constantly forgetting which ones use
.size() and which ones .len(). It's not worth committing to memory because, if
I get it wrong, the compiler will tell me "what is this function of which you
speak?", and I will simply turn around and use the other one, at which point
it starts compiling again, wasting me at most a minute of my time.

Furthermore, I should point out that it's not out of the imagination that
someone wouldn't use len() all that heavily. Python has functional operators
that let you do map/reduce-style operations on lists, strings, dicts, etc.
that don't require you to use length all that much. My most recent python
script only uses len() in two places for more robust error reporting.

~~~
commandlinefan
Well... try not to take this personally, but... that means that you're not
really an expert in Python, which is what (I assume) the interviewer in the
linked post was looking for. You're capable in several languages, and may be
an expert in one or more of them, but if they're looking for Python expertise,
asking you how to find the length of a string is a good way to get a feel for
how much time you're going to need to get to where you can really be trusted
to produce mission-critical Python software (which may not be a deal breaker,
if you're good at a lot of other things).

------
gremlinsinc
Anyone ever go in w/ an iron clad algorithm you've perfected then when asked
'Do you have any questions for us?' be like..yeah, I only work w/ the best
developers can you beat my algorithm?

or hell just ask them if they can do a whiteboard problem for you. See how the
recruiter likes it. See if they do as good as you. Flip the script so to
speak!

------
Gunax
I wish I got asked questions like this.

Usually it's just 'How many years of experience do you have in XYZ?' and it's
almost never enough. Doesn't matter if your experience is in something similar
('Oh you used Spring boot! We are looking for Spring MVC!') and of course they
just care about decades of 'experience'\--doesn't matter if you actually know
it well.

Then the job ends up not having any relation to what was posted anyway, so it
was all moot.

Yes, I am salty. I am sick of taking 'exciting' opportunities just to end up
babysitting software that has no relation to the posted skills/requirements.

~~~
jagged-chisel
My favorite is "Yes! We'd love to have someone with broad experience who can
dive in a learn new stuff!" followed by "you've read the $TECHNOLOGY_TOOL
docs, but haven't deployed anything with it? Sorry, we're taking a pass..."

------
loopz
In theory, algorithms are an important aspect of CS. Having learned about them
plus some experience, enables the logical thinking mindset required to develop
better code. In practice, algorithms are hardly useful, either because T&M
don't allow it, or the problem gets escalated when adding dependencies to
existing code and services. In theory, some CS, algorithmic or systems
thinking background may be that crucible required to avoid many known pitfalls
and rabbit holes. In practice, developing and maintaining IT systems have
nothing much in common with sports. This being something more of a distraction
by ignorance and management, than anything of tangible value to people and
environment.

------
zwieback
Asking hard brainteasers in interviews is questionable but bubble sort is so
simple anyone should be able to do it or at least start writing a correct loop
to go through the list and put a useful if statement in there.

If you don't remember bubblesort the interviewer could explain what the algo
does and then you should be able to implement it. I'm all for looking stuff up
on the web and we all have phones in our pockets but if there's to be a
minimum bar it shouldn't be lower than bubblesort.

------
stephenmm
I was a little skeptical of take home coding exams but the more interviewing I
do it seems to be a pretty efficient way to screen candidates as it is less
stressful than live coding and more realistic "simulation" of the work they
will do. It also allows you to deep dive into their thought process without
having to worry about semicolons.

A persons ability to think through a problem and communicate it clearly will
get them 75% through the hiring process in my books. (Another ~10% is
curiosity).

------
dplgk
Been a programmer for 20 years and doing the interview dog and pony show for
the first time now. Tons of algo questions out there. Apparently memorizing
algos is more important than actually knowing how to build an app front and
back and knowing how a web browser, http, tcp works. And knowing dev ops and
server admin and how to write maintable code. None of that matters as long as
you can say which easter basket has the most eggs in O(1) time and constant
space.

------
stunt
String length in Python is maybe too much exaggeration unless someone hasn’t
wrote Python for a long time. But, algorithms? Sure! Nobody remembers them for
ever. Often you at least need to read how the algorithm works before
implementing it. Obviously for most devs it is faster to just search for a
sample implementation or a pseudocode.

~~~
tzs
> String length in Python is maybe too much exaggeration unless someone hasn’t
> wrote Python for a long time.

Or they use several languages. Say you have client side code in JavaScript,
with the client served by PHP on the server. You've got some log analysis
scripts in Perl. You've got some SOAP services in Java. You've got some
machine learning stuff in Python. You've got a mobile app in Swift.

It's real easy to get confused about which of foo.length, strlen($foo),
length($foo), foo.length(), len(foo), or foo.characters.count is the right one
for the language you are dealing with at the moment.

------
growlist
Isn't one of the key skills in tech these days knowing how to avoid having to
go low-level? And if not, where does it end? Should we know hardware design?
Particle physics?!

~~~
arthev
Yes.

------
kps
Shouldn't be a surprise; the person who wrote the algorithm without help took
more than 15 minutes, and got a paper or a PhD out of it.

~~~
mark-r
The first time I heard the problem of detecting a circular link in a linked
list, I figured out the tortoise/hare solution in probably 15 minutes without
having heard it before, so it's not impossible.

~~~
commandlinefan
You should have written a paper.

~~~
mark-r
I was hardly the first person to figure it out.

