Holy shit
Typing the technical interview
21–30 of 86 posts
Re: Typing the technical interview
#22It's odd. There are people who complain on Hacker News about interviewers who ask about algorithmic complexity: "when are we ever going to need this?" This is about wasting an interview demonstrating a semi-obscure technique that's fascinating but mostly useless, and it gets widely praised. Seems like it's just that fantasizing about turning the tables on an interviewer is fun, never mind whether it makes sense or no…
Re: Typing the technical interview
#23Earlier quoted context omitted.
People like Criss who ask this question in interviews are looking for a brute force solution with recursive backtracking.
Is that not what's happening here? Except GHC has the recursive backtracking built in? The code looks a lot like the equivalent Prolog implementation.
Re: Typing the technical interview
#24For the N queens on an NxN chess board, wouldn't you put them in a fibonaci spiral? Of course I can draw the board and explain it, but I have no idea how show that fibonaci formula modified for a chess board. Do you think that would be enough?
People like Criss who ask this question in interviews are looking for a brute force solution with recursive backtracking.
import Data.List (permutations)
solve :: Int -> [[Int]]
solve i = filter (valid . zip [1..]) (permutations [1..i])
valid :: [(Int, Int)] -> Bool
valid [] = True
valid (x:xs) = singleValid x xs && valid xs
where
singleValid x xs = all (pairwiseValid x) xs
pairwiseValid (x1, y1) (x2, y2) = abs (x1-x2) /= abs (y1-y2)Re: Typing the technical interview
#25Sad to say, this is exactly the sort of magic that, as the conclusion suggests, gets people not hired. Even on this very enlightened forum people argue in favour of less knowledgeable candidates (even with all else being equal).
Re: Typing the technical interview
#26For the N queens on an NxN chess board, wouldn't you put them in a fibonaci spiral? Of course I can draw the board and explain it, but I have no idea how show that fibonaci formula modified for a chess board. Do you think that would be enough?
People like Criss who ask this question in interviews are looking for a brute force solution with recursive backtracking.
Re: Typing the technical interview
#27 You smile kindly. “Haskell is a dynamically-typed, interpreted language.”
Thou shalt not suffer a witch to live!Re: Typing the technical interview
#28Re: Typing the technical interview
#29It's odd. There are people who complain on Hacker News about interviewers who ask about algorithmic complexity: "when are we ever going to need this?" This is about wasting an interview demonstrating a semi-obscure technique that's fascinating but mostly useless, and it gets widely praised. Seems like it's just that fantasizing about turning the tables on an interviewer is fun, never mind whether it makes sense or no…
Re: Typing the technical interview
#30Sad to say, this is exactly the sort of magic that, as the conclusion suggests, gets people not hired. Even on this very enlightened forum people argue in favour of less knowledgeable candidates (even with all else being equal).