469,270 Members | 1,042 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,270 developers. It's quick & easy.

Java Interview Questions: Am I Being Too Difficult?

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

--

Jul 17 '05
54 16792
> I want someone who doesn't have to be taught any programming skills
on the job; they may need to learn a new API, or how existing code works,
but they're knowledge of patterns, data structures, algorithms, and
Java syntax is rock-solid. Java syntax is enforced by IDEs compilers, etc so, I'd move it out of
this list..
requirement to write BTree might help to test knowledge of patterns,
data structures.. but asking write on board _correct_ syntax (vs.
sudo-code).. I'd took as bad sign of snobbish lead and think twice "Do
I want to work with him?"

Quite true... I just want a big background in these "basics of programming"
kinds of things. Doesn't anybody keep up with that stuff these days?


If background in "basics of programming" is implementation of Knuth
"in their sleep" via copy con MyClass.java .. I don't think so. This
easy if you stack in one language implementing bicycles over and over
again. This days developer (I don't like coder it sounds as typist)
dealing with multiple languages (and versions of languages) myriads of
APIs and ready components.. implementing Btree just doesn't fitt.
Jul 17 '05 #51
SPomytkin wrote:
I want someone who doesn't have to be taught any programming skills
on the job; they may need to learn a new API, or how existing code works,
but they're knowledge of patterns, data structures, algorithms, and
Java syntax is rock-solid.


Java syntax is enforced by IDEs compilers, etc so, I'd move it out of
this list..
requirement to write BTree might help to test knowledge of patterns,
data structures.. but asking write on board _correct_ syntax (vs.
sudo-code).. I'd took as bad sign of snobbish lead and think twice "Do
I want to work with him?"


Considering Java's verbosity, the skill tested might be little
more than the ability to write tiny characters ;-)

Also, the interviewee with the 3.5-point whiteboard handwriting
might be able to excuse syntax errors as artifacts of the interviewer's
failing eyesight. "You're missing a curly brace." "No; it's there."
"I don't see it." "Here: I'll rewrite it a bit larger ..."

There's lots I like about Java, but one must admit that it's
wordy.

--
Er*********@sun.com

Jul 17 '05 #52
SPomytkin wrote:
requirement to write BTree might help to test knowledge of patterns,


a B-tree is a *completely* different (and far more complex) thing than a
binary tree, and something I certainly wouldn't expect anyone to *write*
as part of an interview. (I implemented a B-tree once. It took me about
two weeks of full-time work).

Now, knowing what a B-tree is, its basic properties along with a general
idea of how it works, that's something that might make sense in an
interview - and you just failed that part...
Jul 17 '05 #53

"Eric Sosman" <Er*********@sun.com> wrote in message
news:40**************@sun.com...
Of course, if you were to choose something too simple ("My
favorite data structure is the free-standing `int' variable"),


Ha ha! :)

l8r, Mike N. Christoff

Jul 17 '05 #54
F
In comp.lang.java.programmer Spammay Blockay <SP*********@blockedtoavoidspam.com> wrote:
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.

"Tree??!? Algorithms??? HUH?? recursion?!? That's old-fasioned. I know
everything about XML, J2EE, EJB, JMS, Enterprise Solutions and Deployment
Descriptors. That's the real more professional stuff."
F

Jul 17 '05 #55

This discussion thread is closed

Replies have been disabled for this discussion.

By using this site, you agree to our Privacy Policy and Terms of Use.