3 msΒ·
Ask HN: Reinventing the wheel during interview challenges
When interviewers give candidates programming challenges, do they want you to write algorithms on your own or use standard library utilities?
On one end it can be impressive to write code from scratch. On the other, sometimes they just want someone to get the job as soon as possible.
- przybytniewski 5y agoI guess it depends on the task. From my perspective I wouldn't mind using libraries, as we do it on a daily basis.
- verdverm 5y agoProbably case by case. We tell the candidate to assume library functions. If we want them to implement something they assume is library, we will tell them to write it out. Interviewers come in all shapes and shades, best to ask at the start of the problem. Sometimes you are being evaluated more on your questions and thinking than on getting the right code or answer.
- pipeline_peak 5y agoWhat would you say about a programmer who's trying to practice for these sort of challenges? Does it still depend on that point?
- PaulHoule 5y agoI think a good programmer in language X knows the standard library of language X like the back of their hand. They know how to look anything up in the manual instantly if it's not in their head. They also are facile with the extended library (e.g. pypi, maven central, npm, ...) Any good programmer also knows algorithms, not just being able to code them out of their head but also when to look them up in an algorithm book. I'm sure I could figure out a good algorithm for making a suffix tree if I had weeks to spend on it, simply knowing that it's possible. I know there are several clever ideas that have to combined to make it scalable for practical use so if I really need a suffix tree algorithm I am going to either use one somebody else wrote or I am going to start with a description of the algorithm from a book on my shelf. From the viewpoint of being prepared for an interview ideally you (a) have it all, and barring that (b) gracefully use what it is you have under pressure.
- PaulHoule 5y agoI've rarely seen a data science interview question that can't be answered with: (1) look it up in the hash table or (2) look it up in the literature. There is a whole range of algorithms (say topological sort, transitive closure, or suffix trees) that will send me immediately to look at an algorithms book or to look up an implementation in the standard or extended library. (e.g. pypi, npm and the maven central repository count as "the extended library") There's something nice about sorting algorithms from the viewpoint of algorithm theory (usually you can prove that they always make forward progress) but almost any coder today will use the ππππ() function from the stdlib.