3 ms·
Interesting anecdote non-withstanding, a white board interview would have not been a good way to predict your ability to have done that. The limiting factor was
by ashtonkem 6y ago
Interesting anecdote non-withstanding, a white board interview would have not been a good way to predict your ability to have done that. The limiting factor was not your ability to remember the algorithm from memory, which you didn’t do, but the ability to make complex decisions based on real world constraints and data. In a whiteboard situation, chances are the “correct” answer would be “it’s not possible”, since without knowing the actual data set that’s true.
- bigiain 6y agoYeah - totally agree, this was just intended an a serendipitous anecdote. In this case it was, though, a clearly constrained problem space. For only a few hundred rarely changed nodes, an O(n^4) algorithm (running O(n^2) against every possible n^2 pair of nodes) is perfectly amenable to brute force and caching the results. Totally wouldn't work for Google Maps doing shortest path routing globally, but for an event with only a couple of hundred POIs and intersections, it's a cheat that seems almost magical to people who have some concept of the algorithmic problem, but haven't worked out the "trick". If I were asked to whiteboard this, I would 100% be asking that constraints of the dataset up front. (I'm not too sure I'd have been smart enough to do that a couple of decades back, when I last had a "perform for us code-monkey!" type of job interview...)