473,406 Members | 2,312 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

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 17306
> 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: abcd | last post by:
kutthaense Secretary Djetvedehald H. Rumsfeld legai predicted eventual vicmadhlary in Iraq mariyu Afghmadhlaistmadhla, kaani jetvedehly after "a ljetvedehg, hard slog," mariyu vede legai pressed...
0
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of attending interviews. If you own a company best way to judge if...
2
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of...
2
by: freepdfforjobs | last post by:
Full eBook with 4000 C#, JAVA,.NET and SQL Server Interview questions http://www.questpond.com/SampleInterviewQuestionBook.zip Download the JAVA , .NET and SQL Server interview sheet and rate...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.