r/programming • • 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

1.1k comments sorted by

View all comments

2

u/Fabalabulous Sep 22 '20

People here seem to think that this problem is ridiculous. Is the general consensus that this is a difficult problem? Or is it just that it doesn't at all apply to the job you will do? I did my degree in mathematics so I think that this sort of question plays into my hands much more than a straight computer science question.

2

u/[deleted] Sep 24 '20

I really like the problem. Many brain teaser problems require the candidate to make one big leap that may or may not come to mind, so they come down to luck, which is a terrible way to judge skills. This knight problem can be attacked systematically, and the solution can be improved upon in many ways. That works much better in an interview situation.

1

u/Fabalabulous Sep 24 '20

I solved the problem by reducing it to a graph. Arrived at a pseudo solution in about 10 mins, although mine was linear. I figured there was probably a constant time solution but I thought that was probably over-engineering a solution. So I guess I learnt that in interviews there's no such thing as an over-engineered solution :P

0

u/troll123456789098765 Sep 23 '20

Nah it’s a relatively straightforward problem if you have a good cs or math degree and you weren’t struggling to pass your classes, may be biased in my favor though because i only graduated a couple years ago. Seems like maybe on the easier side of leetcode medium difficultly problems