4 ms·
"Write a maze solving algorithm" I just solved that in less than 3 seconds. Here is the solution in a Fiddle[0] and the discussion on Stack Exchange.[1]Sorry, I
by zappo2938 11y ago
"Write a maze solving algorithm" I just solved that in less than 3 seconds. Here is the solution in a Fiddle[0] and the discussion on Stack Exchange.[1]Sorry, I'm too busy solving problems which haven't been solved yet to bother with problems that have been solved.
[0]: http://jsfiddle.net/5g7se8qL/7/ http://jsfiddle.net/5g7se8qL/7/
[1]: http://stackoverflow.com/questions/16173259/javascript-maze-solver-algorithm http://stackoverflow.com/questions/16173259/javascript-maze-...
- LaurenceW1 11y agoYou wrote that in 3 seconds huh
- deleted 11y ago[deleted]
- kefka 11y ago"Solved that". There was nothing about being a new creative and novel solution. And in terms of time gained and effort expended, this "LMGTFY" technique is the best. Again, I like working on things that aren't on StackExchange.
- tgeo 11y agoTo be fair, I think he meant he "solved" it by googling and finding a stack overflow link. He wasn't being literal (I thought he was as well at first).
- zo1 11y agoMaybe he's poking fun at the fact that in 3 seconds of searching he can solve the problem? A problem that would, without prior maze-solving knowledge/experience, have taken far longer than 3 seconds.
- metaphorm 11y agoand what does that have to do with the author's point? or did you just want to show off...
- deleted 11y ago[deleted]
- wlesieutre 11y agoAnd then when they ask you to solve a real problem they're working on instead of a contrived algorithm, you can complain about how they're expecting you to do work they can profit off of but aren't paying you for the interview. Or they could find some obscure (and unrelated to their product) algorithmic problem that's been solved before but isn't posted on StackOverflow, and you can complain about how it's just trivia and not a useful problem. No matter what the question is, there will always be some reason that the job interview is a waste of your time and you could have spent your afternoon off curing cancer instead. They want to know if you can solve problems. The maze is an (imperfect) test from which they hope to extrapolate whether you could solve future problems. The future problems will not all be written up word-for-word on a Q&A site.
- deleted 11y ago[deleted]
- yes_or_gnome 11y agoThe simplest algorithm for solving a maze is to pick between 'left' or 'right'; I'll pick 'left'. Then the algorithm is: Whenever you are presented with a choice on which direction to go, then follow the 'left' wall. In the worst case, you'll hit every square and there will be a lot of retracing, but it'll get the job done. It's the equivalent of bubble sort for solving mazes. (My apologies, to zappo2938, I didn't dive into your code, though I did skim it. I didn't want to create a new top-level comment about the maze problem.)