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 sync…
My guess would be that simplest way to sync two threads is exit them both. ;)
The Programming Interview from Hell
141–147 of 147 posts
Re: The Programming Interview from Hell
#142I 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 tryin…
linked list is not complex for christ sake.
...unless you need them for lock-free programming. There was a nice C++ talk by Herb Sutter on that, with the apt title "Juggling Razor Blades". That pretty much says it all.
From a practical standpoint, the question "what is a linked list good for?" really might be more interesting. Does anyone know of potential use cases besides kernel design, lock free programming or Clojure-style immutable datastructures? I'd guess CPU caches to have erradicated most of them...
Re: The Programming Interview from Hell
#143Earlier quoted context omitted.
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 woo…
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.
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.
Re: The Programming Interview from Hell
#144Earlier quoted context omitted.
You can raise IRQL and get okay synchronization on simple systems. It was fine for early versions of Unix, and I've used it quite a bit on uniprocessor embedded systems. Just a few instructions, hard to get wrong. Of course it fails if you're working in user mode. Or you have non-maskable interrupts that you need to sync with. In this case the poor PhD x 2 had been working for years on consumer PCs, which were at the…
Early versions of Unix were co-operative. While a task executed kernel code, it was not preemptable. That might be the simplest thread synchronization. Masking interrupts is then just for exclusion between the one and only kernel thread, and interrupt context.
Re: The Programming Interview from Hell
#145The 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 sync…
> 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.
Re: The Programming Interview from Hell
#146I 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 tryin…
linked list is not complex for christ sake.
Few questions I usually ask:
- How can you make sure that your Java application runs on the server not only on your laptop? (I take any answers: containers, single JAR, etc.)
- What is printed out
def add_list(val, list=[]):
list.append(val)
return list
print add_list(10)print add_list(20)
print add_list(123,[])
- Explain recursion
Funny to see how a non-trivial amount of programmers fail to answer these questions.