r/programming • u/ldxtc • Sep 22 '20
Google engineer breaks down the problems he uses when doing technical interviews. Lots of advice on algorithms and programming.
https://alexgolec.dev/google-interview-questions-deconstructed-the-knights-dialer/
6.4k
Upvotes
3
u/schlenk Sep 22 '20
There should be a closed form solution that runs in constant time. After all, the graph is quite small and fully deterministic, so there must be a repeating pattern once the phase space loops back to a starting position you already know. Once you found the period size for each starting point, a lookup table would work. Might be too memory heavy in the worst case though.