|
What're some of the good interview questions that you've had/heard?
One of the better ones I've heard recently is "how many ways can you build a function that returns 1 if given 0 and 0 if given 1?"
|
|
|
|
|
There're a ton of ways. That's a shitty question.
|
|
|
|
The actual point is to see how creative they can be. While interviewing MIT students for Amazon, Dave asked that. He had one guy who couldn't get past this: if n == 0: return 1 else: return 1 Then you get these ones though: return 1-n return n^1 return (0 < 1)*1 The point is though, that some people get stuck and don't know very little in terms of alternative ways for doing things. They get stuck in "mine is already good enough" mode and then don't look for alternative methods unfortunately. Here's one for you than Eric: (You'll probably get it if you've worked with bit operators at all) That was from a Google or Microsoft interview in the past. Can't remember which. Also, if those are bad, then what are some good ones you've seen?
|
|
|
|
|
I know what the & operator does. It's true for 0 and 2 and not 1 or 3, past that I don't feel like figuring out.
String parsing is always interesting, asking them to intentionally generate a specific error is interesting too.
|
|
|
|
String parsing in what sense? Specific error would be fun too. As for that... it tells you whether or not the input is a power of two. Simplest way I believe.
|
|
|
|
|
Interpreting a string in some way, whether it be making an "intelligent" array of some sort, or a regular expression to pick out data.
|
|
|
|
Gimme some silly questions to play with! D:
|
|
|
|
Not a puzzle, but a tricky question I've seen on stackoverflow: explain why extending native JavaScript objects is a bad idea. Also, hi. Long time no see, not sure if anyone remembers me.
Last Edit: Apr 7, 2012 0:33:57 GMT by virtuoso92
|
|
|