4 ms·
> If you've never heard of dynamic programming there's absolutely no way you're going to come up with that in an hour. Dynamic programming problems are really
by kosievdmerwe 6y ago
> If you've never heard of dynamic programming there's absolutely no way you're going to come up with that in an hour.
Dynamic programming problems are really terrible for interview signal though.
Firstly, it's mostly an aha moment or two trying to realize the relationship between the elements. Not really lots of signal there.
Secondly, the code is trivial in 99% of cases. Just set up an initial (likely multidimensional) array, some for loops to iterate in the right order and then apply the formula. Returning the right array element at the end.
Also terrible signal, since the initial fizzbuzz question during phone screens or whatever should've caught an inability to code.
That said, yeah, the algorithms bit of interviews are the bits that are scary to me, since they're the biggest dice rolls. Everything else just has normal levels of unexpected events that you learn to deal with during your job. However, I write proper algorithms once or twice year and, even then, just trivial ones.