4 ms·
For my Facebook interview for an internship, I was given a simple string manipulation problem which I solved quickly. Then I was given the N-Queens problem (a
by somethingnew 13y ago
For my Facebook interview for an internship, I was given a simple string manipulation problem which I solved quickly. Then I was given the N-Queens problem (a more generalized version of this one http://en.wikipedia.org/wiki/Eight_queens_puzzle http://en.wikipedia.org/wiki/Eight_queens_puzzle). Needless to say I didn't solve that with my remaining time, since the interviews are only 45 minutes. I didn't feel it was a fair assessment of my skills.
- gburt 13y agoWhere there other constraints on your N-queens? (no bruteforce? no backtracking? must run in X time?)
- somethingnew 13y agoReally it was just write code to verify whether it can be done or not (return boolean) based on the N input (integer). Without having to write code it would return true for N >= 4, but I didn't know that. I was just trying to get an initial solution down with recursion, not thinking about backtracking yet or worst case time (which was probably 2^N).
- mattacular 13y agoDo they really expect people to solve 8 queens in under 45 minutes? Even if you already know how to approach the problem, writing out the code to do it would take most of that time it seems like. Maybe they were trying to ascertain something else about their candidates. Like how they approach problem-solving in general?