HACKER Q&A
📣 pipeline_peak

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.


  👤 PaulHoule Accepted Answer ✓
I'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.


👤 verdverm
Probably 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.


👤 przybytniewski
I guess it depends on the task. From my perspective I wouldn't mind using libraries, as we do it on a daily basis.