G
Guest
I've been tasked with doing technical interviews at my company,
and I have generally ask a range of OO, Java, and "good programming
technique" concepts.
However, one of my favorite exercises I give interviewees seems
to trip them up all the time, and I wonder if I'm being too much
of a hardass... it seems easy enough to ME, but these guys, when
I get them up to the whiteboard, seem to get really confused.
The exercise is this:
Create one or more classes that represent a binary tree.
This class(es) must be able to do standard sorts of operations
one would do on a binary tree in a good, OO sort of way.
A node in this tree holds only a single, String, value.
Now write for me a method named 'find' that takes an argument
of a String (or a String and a Node, depending upon your
implementation) and returns a java.util.List of all nodes,
from the node it's called upon and all descendent nodes, inclusive,
who's value matches that of the String argument.
The code must be syntactically correct, and would compile.
As an added exercise, how would you make this code thread-safe?
Seems pretty simple, huh? But most guys we've brought in just sit there
staring at the board, and have trouble even writing the basic
Node class... they get all confused, don't know how to traverse a
tree, etc.
Am I unreasonable in expecting someone to be able to do this???
- Tim
--
and I have generally ask a range of OO, Java, and "good programming
technique" concepts.
However, one of my favorite exercises I give interviewees seems
to trip them up all the time, and I wonder if I'm being too much
of a hardass... it seems easy enough to ME, but these guys, when
I get them up to the whiteboard, seem to get really confused.
The exercise is this:
Create one or more classes that represent a binary tree.
This class(es) must be able to do standard sorts of operations
one would do on a binary tree in a good, OO sort of way.
A node in this tree holds only a single, String, value.
Now write for me a method named 'find' that takes an argument
of a String (or a String and a Node, depending upon your
implementation) and returns a java.util.List of all nodes,
from the node it's called upon and all descendent nodes, inclusive,
who's value matches that of the String argument.
The code must be syntactically correct, and would compile.
As an added exercise, how would you make this code thread-safe?
Seems pretty simple, huh? But most guys we've brought in just sit there
staring at the board, and have trouble even writing the basic
Node class... they get all confused, don't know how to traverse a
tree, etc.
Am I unreasonable in expecting someone to be able to do this???
- Tim
--