C
Chris Uppal
Andrea said:[...]My own (rather limited) experience of interviewing is that candidates
who can't answer questions like Adam's tend not to understand the
basics of anything. I don't know about Adam's questions /specifically/
(though they seem reasonable to me), but in general easy-but-low-level
questions seem quite good at exposing the programmers who have learned
by rote, or have been subjected to "task-oriented" education.
I think the question is how easy and how low-level the questions must
be. Personally, in 4 1/2 years of Java:
- I have never used System.identityHashCode()
Understandable. They didn't even get around to adding to Java until after it
had been out for a while (though I don't consider /that/ understandable ;-)
- I have never used Object.hashCode()
You have never used a java.util.HashTable or java.util.HashSet ? Or do you
just mean that you've never had to write something which /used/ the hash code
(which would be perfectly reasonable).
- I might have even never implemented a hashCode() method
But you know how to do it, and why and when you must do it. What's more,
you, /need/ to know these things, whether you've had occasion to use them or
not -- a requirement to implement equals() or put instances of a custom class
into a HashSet is routine.
- I might have never looked at the performance of a hash map (I think I
did, but I'm not sure)
There might
be jobs where questions like these are extremely important, and you
really have to know it, but I don't think this is the usual case.
Knowledge of the concepts and attitude are the most important thing; [...]
Well, I agree with the last sentence (as trimmed), but not the first. Or
rather, whether the first is true or not, my experience is that people who /do/
have an understanding (rather than a rote-learned collection of unrelated
facts, and code idioms) /do/ also know these very basic and fundamental things.
There are lots of other basic and fundamental things, some of them may be more
important, but -- since you have to know /all/ of the basics -- probing /any/
of them is a good test (if suitably interpreted). And, since I think that
anyone with real understanding will quickly and naturally get all the
basics, I think that testing any of them is an informative test of whether
the candidate has (and wants) real understanding.
BTW, my answer to "Lion-O" talks about some of these things from a slightly
different angle.
-- chris