3 ms·
> How to check if a linked list has a loop? Does one N-dimensional box fit into another N-dimensional box? Can you swap two variables without a third one? How t
by jfasi 8y ago
> How to check if a linked list has a loop? Does one N-dimensional box fit into another N-dimensional box? Can you swap two variables without a third one? How to find the shortest distance between two moving ships? Find all permutations of N elements doing only N-1 swaps?
> Those puzzles are fun to talk about and solutions to them can be very insightful. I used to enjoy lots of them reading Mathematical Recreations and Essays as a kid. Don’t take me wrong, they are fun.
> However, no matter how fun they are, they are merely anecdotes. The property of a puzzle is that you either know the answer to it or you don’t.
I disagree with how the author lumps these questions together. Questions like "Find all permutations of N elements doing only N-1 swaps" are actual brain-teasers and typically require a flash of insight and creativity beyond what most people can do within a 45 minute interview. Questions like "Does one N-dimensional box fit into another N-dimensional box" are algorithmically challenging and can be approached from first principles and solved within an interview. One question does not carry signal, the other does not, and by categorizing them together the author suggests that neither are useful.