
The Programming Interview from Hell - seer
http://pythonforengineers.com/the-programming-interview-from-hell/
======
kabdib
The hiring manager of a small software company gave me a quick brief before
handing me off to his technical heavy. "He's hard to get along with, but he's
really smart. Oh, and he has two PhDs. He'll tell you that."

I was ushered in. The Guy with Two PhDs (he showed me his business card first,
and there were indeed two PhDs on it) asked me:

"What is the simplest way to synchronize two threads?"

I rattled off some synchronization primitives. Semaphore. Critical section. I
was ready to do an implementation if he wanted.

"No, the _simplest_."

I dug around. Interlocked operations? A mutex? A spinlock? I mentioned
Dekker's algorithm (it sucks, but it's simple). I dredged up a few more.

"No, I want the SIMPLEST possible way to synchronize two threads. What is it?"

I'd run out. He gave a disgusted snort. The next question wasn't much better:
"What's the BEST way to share data between programs?"

"Not sure what you mean by best. How many programs? Is it over the network?
Hmm, shared memory and a maybe a signal of some kind?"

"No, the _best_ way!"

This interview did not go well. At the end, Dr. DoublePhd scolded me for
dropping out of college and told me to go back to school to finish my degree.

That evening I wrote the hiring manager that Dr. DoublePhd appeared to want
the answer "raise interrupt priority" for the thread synchronization question
-- which doesn't work on a multiprocessor -- and that I had no idea what the
heck he was asking for on the other questions.

I didn't add that even the awful questions I was being asked could have been
productive interview fodder in the hands of a good interviewer, but that in
the hands of a terrible person they were destroying that company's ability to
hire.

Turns out that I didn't need to add that last bit. A few months later the
hiring manager emailed me, saying that they had fired Dr. DoublePhd and would
I consider interviewing again? I politely declined.

I never found out the BEST way to share data between programs. In fact, I'm
still looking. I think we all are.

~~~
zhte415
> I never found out the BEST way to share data between programs. In fact, I'm
> still looking. I think we all are.

Copy-paste.

~~~
Ntrails
See, I was gonna go with Data.txt in a shared network drive.

Btw = if you're worried about conflicts - it's Ok there's a second file called
"writeStatus.txt" which you have to claim by replacing the String NULL with
your processId - thereby claiming write access to data.txt and causing any
other processes to Thread.Sleep until it's free.

Unrelated, who's hiring...

~~~
willis77
But who has access to writeStatus.txt? Classic rookie mistake. You needed a
writeStatusWriteStatus.txt.

~~~
btschaegg
Sounds like playing Byzantine Generals on the file system :)

------
mankyd
I interviewed someone who gave responses akin to "I'd Google it." When
presssed, he did finally give some reasonable answers.

We ended up hiring him, as we'd interviewed 10 other candidates who'd failed
at that point.

He ended up being a terrible employee.

Seriously, when someone asks you the details of a linked list, they're not
trying to find out if you will be able to use one specifically on the job.
They're trying to figure out if you know how to implement the details of a
moderately tricky algorithm/data structure.

I've never implemented a linked list for work, but I have implemented complex
data structures and other analogous code. Implementing a linked list
demonstrates that I paid attention to the basics and can reconstitute mildly
complex algorithms when needed.

~~~
kppiskingpp
linked list is not complex for christ sake.

~~~
yunolisten
> linked list is not complex for christ sake.

There are many people for whom this is complex, you're assuming a foundation
that not everyone has. There are also many people for whom nothing is complex,
they assume they can understand everything, while they don't currently, they
assume they'll be able to learn it without issue.

Dealing with new starts who are straight out of education is often like
reading posts from 4chan.org/b, at first you don't know if they're joking.

It's not all doom and gloom, occasional I'm pleasantly surprised by the
calibre of those beginning their career/hobby, but this is the exception.

~~~
latch
But there's also nothing crazy about a company saying: for this role, we
expect the candidate know linked lists. It's not esoteric and I think a lot of
us would consider normal programmers who have had to write linked lists (and
other data structures) for one reason or another.

~~~
yunolisten
Personally I agree, however I know people employed to code PHP who have no
concept of this. Some apprentices who have left college have joined our
company who don't know this.

------
vinceguidry
I hope I'm past the part of my career where I go on cold job interviews but if
I ever had to go on another job hunt, I'd simply announce that I'm a web
developer and not a algorithms person and it looks like I might not be the
best fit for the position and just see how the interviewers respond.

Anything less than tossing the playbook warrants a gentle suggestion that we
shouldn't waste any more time here and why don't we just end the interview.
Stand up, shake hands, thank them for their time, and walk out.

Problems in the interview process should be seen as problems with company
culture. I used to wonder about how to appropriately answer the question,
"which companies are worth working for?" because it seems like you need a lot
of time before you can really tell. But once I realized that the interview is
just an _extension_ of company culture, it got a lot easier to weigh
opportunities.

I mean, obviously, if you need the money you need the money, but developers
are hot enough commodities that it doesn't take long before you're entrenched
enough to be able to call the shots like that.

~~~
tbassetto
> I'd simply announce that I'm a web developer and not a algorithms person

A while ago I was invited at a startup for a casual discussion about an open
position they had (front-end developer). I went because I knew several
employees and they were nice. The casual discussion turned out to be several
questions about UDP/TCP and writing algorithms on a blackboard (counting
leaves in a tree, finding is a word is an anagram, etc.). Nothing really hard,
but quite disconnected from the day-to-day job of a front-end developer.

~~~
vinceguidry
I hear about the whole 'casual discussion turns into hardcore interview' ploy
all the time, and curious about a better way to respond to it. It's not a
serious knock on company culture, but it is impolite. I'd probably overlook it
if I didn't have a current job, but would write off the company if I was
already employed. I don't think it warrants a walk-out.

------
Patient0
OK - but here's a genuine problem that came up the other day in my work
(reconciling two datasets - we have various many-to-one mappings of ids that
we then want to reconcile against each other). I think it's quite a neat
computer science/algorithm challenge, so here goes:

Write a function which takes as input a list of sets, many of which are not
disjoint, but will output a list of sets where all of the non-disjoint ones
have been merged back together again. So the output is a list of sets which
are all disjoint from each other because any intersecting sets have been
merged together.

e.g. given the input:

    
    
        [(1,2,3), (2,4,8), (10,11,12)]
    

it will report back:

    
    
        [(1,2,3,4,8), (10,11,12)]

because (1,2,3) and (2,4,8) are not disjoint, but the (10,11,12) set is.

Whereas given the input:

    
    
        [(1,2,3), (2,4,8), (10,11,12), (8,10)]
    

it would report back a single set:

    
    
        [(1,2,3,4,8,10,11,12)]
    

because now all of the sets are connected - the 8 and the 10 now connect
everything else together.

I came up with an algorithm which is acceptable for the dataset we currently
have - but I've no idea what time complexity it is (for our real dataset it
was able to do it in "one pass" \- but in principal it could be worse than
that). I don't know how I would implement a distributed version if the list of
sets was too big to fit in memory, etc. etc.

And I haven't found a good solution on Google (but I'm not even sure _what_ to
Google).

~~~
gigatexal
Your two examples have the same inputs but different outputs if I am reading
this right. What did I miss?

~~~
stephengillie
On mobile, the 4th set is hidden until the line is dragged left.

~~~
gigatexal
Dang my bad. Thanks for clarifying.

------
mdekkers
I have been hiring technical people for about 18 years. 15 years for my own
business. I stopped with all the bullshit questions years ago. My own research
into which approach to interviewing is the "best" turned out to be a tossup.
You can spend a day, or even days to go through a gruelling interview
schedule, and your success rate won't be significantly higher. We are not
Google, we don't have their needs, and we don't have the resources. If I'm
looking for a dev or ops person, and your CV matches the skills I am looking
for, and I have a good feeling about how you present yourself on paper (decent
cover letter, decent CV, etc.)you'll be invited for a formal interview, where
we will discuss your CV (tell me a bit more about this job you list here,
etc.) takes anywhere between 15 to 60 minutes. If there is a connection and a
good vibe, your next interview will be informally, in the pub, with the rest
of the team to see how you get on. This approach has netted me a higher
percentage of succesful long term hires then any other approach. I trust that
if you apply for a developer position, you will actually be able to cope. Your
skillset will be determined during your probation period, which is something I
make clear beforehand. Your probation is where we see how good your skills
are.

~~~
aphextron
I really wish there were more companies like this. Interviewing in SF/Silicon
Valley is an absolute nightmare and I've basically given up. I simply can't
put myself through that ordeal of weeks of back and forth emailing and talking
with recruiters, followed by multiple day long interviews, just to be rejected
because I couldn't whip out an algorithm on your white board in front of five
people while interviewing for a basic front end position.

------
itp
I get that this is a caricature, an exaggeration of reality that's trying to
convey some bad practices. It must be incredibly frustrating to be on the
receiving end of an interview this bad! But I'm not sure all of this plays
particularly well, and I want to push back a little bit.

For context here, I'm a college dropout. I made it through two years before I
discovered that I could skip right to having a job, and for where I was in
life, it was the right decision for me. But seriously, what's the deal with
this hatred of "Big O" notation?

This isn't some cryptic language only for use by CS PhDs. It's not even a
concept that's hard to explain to someone who isn't in our industry!

"The question we're trying to answer here is, how does our solution scale as
the problem gets bigger? Are we able to solve it in the same amount of time
regardless of size? Does our solution take more time as the problem gets
bigger, but only in proportion to how much bigger the problem is? Or does our
solution take much, much longer as the problem gets bigger, to the point where
it's no longer feasible to solve?"

Asking a candidate to be able to have a conversation about this -- how do time
and space complexity scale -- is not unreasonable. This is the difference
between designing a workable solution early, and discovering that what worked
great in a unit test and some one offs behind the scenes fell over in
production.

Similarly, I see no problem in expecting a candidate to have some familiarity
with the basics of simple data structures. I don't generally rewrite them
either! But I use data structures all the time, exposed to me via the standard
libraries of programming languages that I use, and if I don't broadly
understand how they work, when they are appropriate and when they're not, and
when one choice is superior to another, I'm not doing my job.

I agree that in a lot of instances, Google is the answer. But Google is of no
help if you don't know what to ask, or worse, if you don't even understand
that there's a question to ask.

I'm not defending the truly awful interviews that I believe really do happen.
But let's not pretend that it's not important to understand how these details
work to get proficient, or even adequate, at our jobs.

------
ensiferum
Thats hilarious.

I was once interviewing for a C++ position and the interviewer presented me
with some C code with a broken "swap" implementation and a driver function and
asked me to fix it. I simply prefixed the call to swap with "std::".

He wasn't very happy about it. ;-)

~~~
ryandrake
Nice. I was once asked to implement a basic filesystem API in C++ including
file manipulation, directories and paths, etc. I just said use
boost::filesystem and move on with your life. Interviewer was not impressed
but at 95% of companies that's what you are going to want to do.

Can you imagine interviewing someone to build you a house and spending 90% of
the interview time asking him how he'd chop down trees for wood and
manufacture the nails? Welcome to software interviewing.

~~~
scarface74
I partially agree. It depends on what you are hiring for. If you are hiring
for a low level code monkey, you want to see how they code. If you are hiring
for a senior level engineer/architect, you want to see how often they _avoid_
coding and know how to leverage existing frameworks.

~~~
ryandrake
Old post but wanted to respond: Even when interviewing more junior roles, I
want to see the solution that involves the smallest amount of code, ideally no
code. Nothing wrong with expecting that existing mentality from both junior
and senior people alike. Saves you from having to instill it.

A candidate's ability to re-implement the language's standard library is not
so useful if we simply use the language's standard library in our application
code.

------
coldcode
What a fun interview it would be to actually do this.

My favorite interview was for an architect position, where my two future peers
took turns telling me horror stories about working there, to see if I would
run away screaming. I got the job and only ran away screaming 18 months later.

~~~
gagege
I've learned in the past few years that, if the interviewers gripe about
anything in the interview (especially management), it's best to stay away from
that company. In an interview, the company is trying to put it's best face on
to sell themselves to you, and if the employees can't hold it in for 30
minutes, that's a bad sign.

------
monodeldiablo
I've actually used (politely, of course) many of these answers in interviews,
whenever I felt the interviewer was trying to show off or read from the script
instead of actually judging my abilities.

"I'd google it. Anything less would be a waste of our time." That cuts through
a lot of bullshit. After saying that at my last interview, we got into actual
problems (structuring a program, building an API, writing code to
approximately simulate real world problems, data structures). Had a good time,
got hired, and loved working with those people.

On the other end of the spectrum, I've been torn to shreds in an interview for
not being able to write a fast hash table implementation in Java (didn't know
Java at the time and the interviewer didn't know Ruby/Python/C) in an hour of
trying. That was soul-destroying.

~~~
tomjen3

        new java.util.HashMap()
    

In case you ever get such a stupid question again.

~~~
monodeldiablo
Yeah, I'm fairly proficient these days. But even then, I expressed amazement
that Java didn't have a built-in or library data structure.

"It does."

"Then I'd use that."

"That wasn't the question."

"Oh... kay..."

------
SeanLuke
> Manholes covers are round because that is the shape that won’t fall in

It's worth mentioning that this oft-repeated canard doesn't have much
evidence. Manhole covers come in a great many shapes, and this has always been
true: the Romans made them square. There are plenty of shapes which won't fall
in, such as any curve of constant width. Basically fake-Feynman is right:
manhole covers are round because it is often convenient to make manholes
round.

~~~
Neliquat
Modern manhole covers are overwhelmingly round, and cast as not to fall into
their own fitting, also cast. Not sure how a obscure counter example does
anything other than disprove your point further. Source: worked IT for public
civil engineer for a few years.

~~~
zero_iq
I assume that by 'obscure' you mean 'outside your-state, USA'. Here in the UK,
rectangular manhole covers are the overwhelming majority.

------
8166284
I've called out interviewers for stupid puzzle questions multiple times. Never
got the job in any case, but I like to think I improved the hiring process
marginally before being rejected.

~~~
abulman
I've also called out crappy interviews - while in the interview. I went on to
be offered the job - but declined.

------
doppel
While I understand the context is "stupid inteview questions", I would not say
Big O-notation is useless, even for non-Google companies - just read some of
the stories at thedailywtf.com to learn how bad it gets.

Also, there's a difference between asking "How would you solve X (in Y
language)" and expecting a line-by-line code sample. In the former you should
be able to talk about how you would structure the code, what input/output you
would need, how to set it up, data stores, etc. whereas the latter is
(virtually) impossible without help from Google.

While it would be lovely to hire candidates by "everything it says in the
resume", the truth is that only works for really great hire... which you don't
know until you've talked to them about how they work, what they've done and
how they like to solve problem.

------
technologyvault
Isn't it interviews like that that turn job-seeking developers into
entrepreneurs?

------
ggggtez
No hire. Bad culture fit. Seriously, even if you think the interviewer is
asking the wrong questions, insulting the interviewer as if it's their job to
fix the hiring process of the entire industry...

------
dleslie
> How do you feel about overtime pay?

We provide industry-leading compensation, but no one pays for overtime so
neither do we.

~~~
kppiskingpp
that's illegal in many countries america is fucked up

~~~
sand500
Exempt employees rip.

------
fishnchips
I once had to use a linked list to implement a sorting algorithm on a huge but
partially sorted input. This was to detect duplications in an AST, for a
static code analysis startup. This was literally the only time I
professionally used any sort of non-trivial data structures and algorithms,
and I've been working in the field for some 10 years now.

~~~
hackerboos
Knowing of data structures is more important IMO. The hoops I've seen people
jump through in code because they don't know about sets.

~~~
adamkittelson
And when you see that do you wish they'd never been hired due to this
insurmountable hole in their knowledge of data structures or do you take 30
seconds to tell them about sets?

~~~
hackerboos
At what point do we just take someone out of high school and teach them to
program?

------
phyushin
It's somewhat ironic that they get horrified when you say you'd Google
something and then the lateral thinking questions are normally the first five
from the Google search 'lateral thinking puzzles'

------
smsm42
I'd take very negative view of interviewee that claims linked lists and big-O
(and optimization lore connected to it) is relevant only in interviews. Of
course, if he's interviewing for HTML-"coding" grunt in a company making
trivial website, I'd get it. But if any substantial programming involved, it's
completely false.

------
cofeafe
I had the exact same interview when applying to be a barista at philz coffee.

The technical questions were my fault because I told the interviewer I was a
researcher in number theory and enjoyed working with embedded systems.. to
which they said, 'oh, can you talk a bit about that?'

Each comma denotes an email response explaining I was chosen to move on and to
please fulfill the next request: Send resume with cover letter, fill out
online application, make 90s video about why you should serve coffee, first
video chat interview, come in to meet recruiter, come in to meet store
manager.

I only made it through the first of the three interviews. Ultimately I think
we both dodged a bullet there.

Honestly!

Ask an employee next time you get a coffee there what kind of interview
process they had to go through.

PS- should have made a 90s '90s video about why I should serve coffee..
definitely would have gotten their minimum wage offering then.

------
watwut
It was fun to read. However, while interviewer was not perfect, the
interviewee was too much crazy.

I always find it suspect when self proclaimed awesome genius programmers take
offense over simple common questions (like linked list). Had it been something
esoteric, ok. But these come up so often and take so little time to learn.

------
Sir_Cmpwn
I wrote a linked list today, outside of a job interview. Systems programmers
exist :'(

~~~
latch
Not even just system programming. It's a fundamental data structure and
concept. I don't think it's unreasonable for a company to say: we expect this
role to understand what goes on behind this abstraction.

------
manu29d
I had a recent interview where it literally went like this:

He: "Hi. My name is [X] from [Y:company]. We were scheduled for an interview
now."

Me: Yes.

He: "Ok. Am I audible?"

Me: Yes.

He: "Cool. [Answer this question]"

Me: _baffled screeching_

He talked about a lot of things then including "How does Node.js manage it's
asynchronus thread? Where is the sequence of functions to run stored in the
memory?". In the end I asked him what was a general day like. To which (no
kidding) his reply was:(sad tone) "It's Friday 6pm. Everyone is having donuts
and here I am taking this interview".

Well, if you're more concerned about your donut, thanks I guess. I got
rejected after this round.

------
sly010
If someone answered with "I'd google it", I would say "go ahead". I don't mind
if someone doesn't know or remember something. That is a random signal. I want
to know however if a person is mentally lazy and therefore is merely a "user"
of technology or the "maker" of it.

That said, being able to at least describe some use cases of some relatively
simple data structure is not too much to ask.

~~~
scarface74
I once had an interview where they gave me some programming problems,
prewritten unit tests that were failing that I had to make pass, a laptop and
told me to use any resource I wanted to help and left me in a room for hour.
It was one of the best technical interviews I've had.

------
letientai299
I was once received a modified version of FizzBuzz (the word is replaced by
company name) for my coding interview (via email). I told the HR person that I
know the problem already, expected to have another more challenge problem. She
asked do it anyway.

I gave them my solution, but, well, my interesting in that company has gone.

------
QML
I'm taking an introductory course to CS, and a week before the midterm they
introduced linked lists -- which to me at first just seemed to be lists within
lists with extra rules. What applications do they have in the real world?

------
leke
I recently graduated and I'm going for my first interview in a couple of days.
It's in a recruitment agency, and it's for a general web developer position.
What do you think I could expect?

------
bifrost
Linked Lists are terrible. They're one of the reasons why early 2000's natd in
FreeBSD was terrible. Ask me how I know!

Here's a hint - I trussed natd while it was running. Ooops.

~~~
erikarn
loooooooooooooooooooool.

------
rammytech
i recently had an interview which was plain smart what i need to get my work
done questions i loved it ( i took that offer ). but then there were few where
they did ask me a question on solution implementation and when i solve it they
said there is a better way to do this and then I would be like ok then let's
discuss but then they were quiet on the other side and waiting to hear me
answer the best possible way to solve question ( like 15 mins )

~~~
gruturo
You should definitely contact a reddit user called CommaHorror.

This is his writing style, which I believe would complement yours quite
nicely:
[https://www.reddit.com/user/commahorror](https://www.reddit.com/user/commahorror)

~~~
rammytech
i completely agree. I wrote that comment from my mobile and it is not my
friend.

P.S : this is replied from desktop. hope this works for you

