Live data from Hacker News

The Programming Interview from Hell

pythonforengineers.com

11–20 of 147 posts

Re: The Programming Interview from Hell

#11
post #6
post #4

> 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…

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.

There are many cities where manhole covers are overwhelmingly rectangular. I'm typing from one right now: Rome. SPQR!

I used to live in a town in the US where many of the manhole covers were shaped like a D.

Re: The Programming Interview from Hell

#12
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. ;-)

Re: The Programming Interview from Hell

#13
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.

Re: The Programming Interview from Hell

#14
post #13

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 tryin…

linked list is not complex for christ sake.

Re: The Programming Interview from Hell

#15
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.

Re: The Programming Interview from Hell

#17
post #9

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…

[deleted]

Re: The Programming Interview from Hell

#18
post #10

> How do you feel about overtime pay? We provide industry-leading compensation, but no one pays for overtime so neither do we.

I think everyone should get overtime pay, it would make the company think about how to get better utilisation out of their staff in an allotted time.

Re: The Programming Interview from Hell

#19
post #9

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…

The standard data structure to look for in this case is the disjoint-set data structure (also called union-find), https://en.wikipedia.org/wiki/Disjoint-set_data_structure. That should make your function fairly easy to implement.

Re: The Programming Interview from Hell

#20
post #9

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…

You could model the problem as a graph (each integer represents a vertex and two consecutive integers an edge, e.g. (1, 2, 3) is a graph with nodes 1,2,3 and edges between 1 and 2 and 2 and 3). Then your problem is just to find all connected components of the graph (https://en.wikipedia.org/wiki/Connected_component_(graph_the....
Post reply on HN