It somehow came up in chat today, and it occurs to me that this is yet another great question that I probably will never ask in an interview:
Tell me how System.Object.GetHashCode() works, here is a computer with net connection, google away.
Personally, it took me 11 minutes to find how the implementation worked, and another seven to find it.
- Candidate faints -> Good timing, would've waste my time staying up and talking
- Cadidate explains that he doesn't care about such things -> and if he can convince me that he doesn't care for the right reasons, excellent.
- Canidate hazzard a guess that is not even remotedly close to the truth, like serializing the object to binary and hashing that -> interesting approach, remind me to send a perf team to your next employer :-)
- Candidate explains that they don't know, but give a reasonable alternative for it -> nice
- Candidate goes and find the implementation -> good, now explain it to me :-)
- Candidate gives the answer of the top of their head -> dude, if you weren't on the BCL team, you are wierd
Hm, I wasn't on the BCL team, so this make me wierd... Maybe I should rethink this approach