472,795 Members | 2,480 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,795 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 17203
> 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...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.