3 ms·
The language is absolutely important, since in haskell I could just: > reverse [1,2,3,4] or if I couldn't use the Prelude (yikes!) reverse [x] = [x]
by substack 16y ago
The language is absolutely important, since in haskell I could just:
> reverse [1,2,3,4]
or if I couldn't use the Prelude (yikes!)
reverse [x] = [x]
reverse (x:xs) = reverse xs ++ [x]
> reverse [1,2,3,4]
The problem is that linked list traversal is a solved problem. Why not throw a novel and interesting problem at candidates? That way you could gain some insight into how they go about solving problems instead of how good the candidate is at memorizing other people's solutions that they could just as easily look up in a search engine in a few minutes.