Hacker News new | ask | show | jobs
by Whodi 4980 days ago
If you follow the links, this was asked to someone interviewing for a job on the Windows team who then posted it to an interview question aggregator, so it's likely that the actual phrasing of the question was lost.

But as best as I can tell, they're considering each 1x1x1 space to be a node like a Rubix cube, and they want a list of all possible paths from the center node to the surface. I imagine that half of the question is making sure that the interviewee presses for details, because there's plenty of problems I see with the question right off the bat. If n is even, there's no single center node, so where does the algorithm start? Can the algorithm traverse diagonally by edges, or only by adjacent faces? Not to mention that there's an infinite number of possible paths for some values of n, assuming paths can cross themselves, for the same reason that there's an infinite number of paths from my front door to my car if I feel like walking in circles for a while.