|
|
|
|
|
by fennecfoxen
4311 days ago
|
|
Fizzbizz? Naah. What you want to do is something more like Minesweep. You go, "Mr. or Mrs. Candidate-Person, we're designing a Minesweep game. You've probably played it before. Here are the rules if you need clarifications. I'm handling the front-end, you write something for the backend." It doesn't matter the programming language they go for or the precise implementation they choose to any one of a number of issues. The question is whether they can build something coherent that actually does what they intend it to. There are basically two main types of candidates: the candidate who approaches the problem and says "I need to loop over every cell in sequence and assign a mine or not based on a random probability! Wait, what do you mean, I need to get a specific number of mines on the board? I'm not sure I can make that happen" ... and the candidate who's worth hiring. That said, I have seen interviewers use this premise to try and push for one particular algorithm as The Answer (the one where you shuffle the coordinates and take N) under the premise that "pick random coordinates, check, and retry" could be slower on ultra-dense gameboards -- but hey, dude, nobody plays 99%-full minesweeps because they're not fun. Meh. |
|
A good outcome I'd look for is the candidate recognizes that loop and mark will not always produce an exact number of mines.
So the ideal interview question I think gives the candidate is a simple task with lots of pitfalls that arise in the naive implementation. The goal is for the candidate to enumerate the pitfalls, and also develop an abstract representation of the problem. Leave the solution / most efficient algorithm out of it.