analytical Skill for Java Development

G

Guest

Hi...All,

Recently I had been attending some interviews(almost after 10years)
for Java Developer/Lead position. At each interview, 75% of the alloted
time was spend was on problem solving sessions or checking the
analytical skills. I was just wondering what has prompted the companies
to include such a session & give so much importance to it.?


Regards,
 
S

SMC

Hi...All,

Recently I had been attending some interviews(almost after 10years)
for Java Developer/Lead position. At each interview, 75% of the alloted
time was spend was on problem solving sessions or checking the
analytical skills. I was just wondering what has prompted the companies
to include such a session & give so much importance to it.?

A couple of reasons we do this:

* resumes are often embellished

* references are only ever positive

* both of the above give you no real idea of how good the candidate is at
actual software engineering

* we don't care if you're a syntax dictionary, we care about the way you
think and solve problems. We're happy with reference book programmers as
long as they have the right mind for software engineering

We've had people who know a language but can't write decent working
software to save their lives.

Best of all, people with good problem solving and analytical skills can
transfer these skills to any programming language. If we one day ditch
Java for Ruby (for example) we'd have confidence in most of our people
easily making the transition.
 
T

Tony Morris

nospam said:
Hi...All,

Recently I had been attending some interviews(almost after 10years)
for Java Developer/Lead position. At each interview, 75% of the alloted
time was spend was on problem solving sessions or checking the
analytical skills. I was just wondering what has prompted the companies
to include such a session & give so much importance to it.?


Regards,

There has been a slight shift in the industry in that the creation of a
distinction between "experience" and "skill" has seen a bias toward "skill".
Skill may (at least, according to the industry) be measured by one's ability
to analyse a problem in contrast to having appeared to analyse many problems
in the past (experience).
The industry is beginning to demand skill and not experience, instead of
equating the two with some blur. One can speculate on the reasons why, but I
would probably base them somehow on the rise and fall of demand a few years
ago.

As an experiment, give an "experienced" developer a problem and watch their
analytical and problem solving skills seriously fail him/her. This of
course, is the general case - there may be some corner cases where this will
not occur. Like many maturing industries in the past, we can only sit back
and wait for these people to retire before serious progress is made. Until
then, one can only minimise the adverse consequences that are caused by this
phenomena, educate, and be educated with, the growing minority - 3 days to
go before I'm outta here!!!

Is it any wonder the industry is littered with failed software projects?
 
I

im

Hi...All,

Recently I had been attending some interviews(almost after 10years)
for Java Developer/Lead position. At each interview, 75% of the alloted
time was spend was on problem solving sessions or checking the
analytical skills. I was just wondering what has prompted the companies
to include such a session & give so much importance to it.?

Could you please post some examples of specific problems you had to solve
during the interviews?
 
A

Adam Maass

im said:
Could you please post some examples of specific problems you had to solve
during the interviews?

1) You have two identical glass balls; when dropped from a certain height,
they will break. If they do not break, they are re-usable. Your task is to
find which floor of a 100-storey building the balls will break on. Describe
in words the algorithm you would use. We are interested in the time
complexity of the algorithm; you should spend the majority of your time on
this question attempting to optimize the algorithm.

Hint: you can always do a linear search with one of the balls, though this a
profoundly suboptimal solution to the problem.


2) You have many piles of rocks. The rocks in each pile are identical. There
are an infinite number of rocks in each pile. You know that the rocks in one
of the piles are slightly heavier than the rocks in all the other piles.
(Say 1.1 kg instead of 1 kg.) You have a scale that you may use exactly
once. Describe an algorithm to determine which pile contains the heavier
rocks.
 
I

Ingo R. Homann

Hi,

I think these are very good questions that show how you solve problems
(and e.g. do not show how exactly you know a certain API or technology
that may - no: "will certainly" - change in the next years or months).

Ciao,
Ingo

PS: Am I wrong, or is the second question (to which IMHO the answer is
obvious) *much* easier than the first one? My first idea was to throw
one of the balls from the 50th floor, but on second thought that is of
course far from optimal (or perhaps on 100th thought it might not be as
bad as all ;-)
 
I

Ingo R. Homann

Hi,
Hi,

I think these are very good questions that show how you solve problems
(and e.g. do not show how exactly you know a certain API or technology
that may - no: "will certainly" - change in the next years or months).

Ciao,
Ingo

PS: Am I wrong, or is the second question (to which IMHO the answer is
obvious) *much* easier than the first one? My first idea was to throw
one of the balls from the 50th floor, but on second thought that is of
course far from optimal (or perhaps on 100th thought it might not be as
bad as all ;-)

OK, new idea: Throw one ball from the 10th floor. If it does not break,
throw it from the 20th, and so on. When it breaks, you know that it is
"breakable" between the n-th and the (n-10)-th floor. You must do a
linear search from then on with the second ball. So you need max. 20
tries. I suppose, the word case generally is 2*sqrt(N). The average case
is eh... sqrt(N)?

Perhaps you can find a much better algorithm, depending on your measure:
Perhaps, it is not interesting, how many tries you need, but how many
stairs you have to go.

Then, when you know that it does not break on the 10th floor, you down
and get the ball, go to the 11th floor, where you throw one ball and
then go 9 stairs up to the 20th floor where you throw the other ball.
That are 2 tries, but only 20 stairs! So, a slightly different algorithm
might be much better!

This becomes *quite* challanging!

Ciao,
Ingo
 
S

stixwix

Adam said:
2) You have many piles of rocks. The rocks in each pile are identical. There
are an infinite number of rocks in each pile. You know that the rocks in one
of the piles are slightly heavier than the rocks in all the other piles.
(Say 1.1 kg instead of 1 kg.) You have a scale that you may use exactly
once. Describe an algorithm to determine which pile contains the heavier
rocks.

Huh? Surely this is not possible to determine?
 
S

stixwix

im said:
Could you please post some examples of specific problems you had to solve
during the interviews?

There are 7 visually identical balls. One ball weighs slightly more
than all the others.
Use a weighing balance to determine the heavy ball in the least number
of attempts.
 
P

paul

Huh? Surely this is not possible to determine?

What counts as "once"? Does put rock from pile a on left, then from b on
right, then from c on left, then from d on right... count as one use?
 
A

Andrea Desole

stixwix said:
Huh? Surely this is not possible to determine?
take 1 rock from the 1st pile, 2 from the 2nd, etc. The total weight
should be 1+2+3+...+n kilos. If it's .1 more the rocks from the first
pile are heavier, if it's .2 more the rocks from the second are heavier,
and so on. I knew the solution :)
I find the first one harder; I would probably go with a binary search at
the beginning to do it faster, until the first ball breaks, and then I
would do that linearly.
 
S

sunanda.sony

stixwix said:
There are 7 visually identical balls. One ball weighs slightly more
than all the others.
Use a weighing balance to determine the heavy ball in the least number
of attempts.

Hey it is quite easy. U can know it in 2 attempts. Devide the 6 balls
into two sets and keep the 7th ball separate. Now keep these 2 sets of
ball in the both side of weighting balance. If both side weiht equally
than the 7th ball which kept separately is the one with different
weight. If both sides are weighting differently then take the set of
ball which is heaver. Now out of these 3 balls keep one ball separately
and keep rest 2 balls in the both side of the weighting balance. If it
weights equal then the 3rd ball kept separately is the one with
different weight. Else the ball which weights more in that weighting
balance is the required ball.
So in the least 2 attempts u can find out the required result. this is
nothing but the binary search.....
 
I

Ingo R. Homann

Hi,

Andrea said:
take 1 rock from the 1st pile, 2 from the 2nd, etc. The total weight
should be 1+2+3+...+n kilos. If it's .1 more the rocks from the first
pile are heavier, if it's .2 more the rocks from the second are heavier,
and so on. I knew the solution :)

Yes, this is easy.
I find the first one harder; I would probably go with a binary search at
the beginning to do it faster, until the first ball breaks, and then I
would do that linearly.

As I explained in another post, this was also my first idea. But this
fails: When you throw the first ball from the 50th floor and it breaks,
you have to do a linear search from 1 to 49. That's hard.

What do you think of my ideas explained in my other posts?

Ciao,
Ingo
 
C

Chris Uppal

take 1 rock from the 1st pile, 2 from the 2nd, etc. The total weight
should be 1+2+3+...+n kilos. If it's .1 more the rocks from the first
pile are heavier, if it's .2 more the rocks from the second are heavier,
and so on. I knew the solution :)

That depends on knowing the specific difference between the weights of the
heavier and typical rocks. It is not clearly stated in the problem definition
that you do have that information. The phrase "(Say 1.1 kg instead of 1 kg.)"
sounds like an indication of the /kind/ of difference ("small but not tiny"),
rather than a statement of the actual number.

Typically vague/incomplete requirements specification...

Another problem that the customer hasn't thought through is how you are
supposed to prise a rock off any of the piles all. Being infinite massive, the
piles' gravity would be something of a problem, as would their natural tendency
to collapse forming black holes.

-- chris
 
T

Thomas Hawtin

Ingo said:
I think these are very good questions that show how you solve problems
(and e.g. do not show how exactly you know a certain API or technology
that may - no: "will certainly" - change in the next years or months).

I think they're party tricks. Java hasn't changed much since 1.1.
PS: Am I wrong, or is the second question (to which IMHO the answer is
obvious) *much* easier than the first one? My first idea was to throw
one of the balls from the 50th floor, but on second thought that is of
course far from optimal (or perhaps on 100th thought it might not be as
bad as all ;-)

I would have through the probability of a ball (pair) breaking when
dropped from the first given it does not drop from the ground floor is
much greater than it breaking from the 100th if it did not break from
the 99th. Perhaps the vast majority of balls don't break when dropped
from the 100th, so the first ball should be dropped from the top first off.

Tom Hawtin
 
T

Timbo

Thomas said:
I think they're party tricks. Java hasn't changed much since 1.1.



I would have through the probability of a ball (pair) breaking when
dropped from the first given it does not drop from the ground floor is
much greater than it breaking from the 100th if it did not break from
the 99th. Perhaps the vast majority of balls don't break when dropped
from the 100th, so the first ball should be dropped from the top first off.
Assuming that the ball breaks at the top floor, from where would
you drop the 2nd ball? You have to start from the ground and do a
linear search. Furthermore, if you are guaranteed that the ball
will break at some point from 1-100, then you know it will
certainly break at floor 100.
 
I

Ingo R. Homann

Hi,

Thomas said:
I think they're party tricks. Java hasn't changed much since 1.1.

Java has changed very much in the last years. E.g. think of generics.

And the technology around Java has changed much more.

Example: 5 years ago you probably would have written an Applet which now
you write as a Java-Webstart-Application. Although your specific
knowledage about applets is still true (did not change), it is now more
or less worthless.

Whereas the value of your *general* konowledge about
Client-Server-Architecture did not change so much.

But the value of your general problem-solution-capabilities did not
change at all.
I would have through the probability of a ball (pair) breaking when
dropped from the first given it does not drop from the ground floor is
much greater than it breaking from the 100th if it did not break from
the 99th. Perhaps the vast majority of balls don't break when dropped
from the 100th, so the first ball should be dropped from the top first off.

Sorry, I don't get what you mean. (One reason might be that I did not
even realize the grammar of your first sentence. Remember, I'm from
Germany and my English is not the best...)

Ciao,
Ingo
 
A

Andrea Desole

Ingo said:
As I explained in another post, this was also my first idea. But this
fails: When you throw the first ball from the 50th floor and it breaks,
you have to do a linear search from 1 to 49. That's hard.

yes, but that's the worst case.

What do you think of my ideas explained in my other posts?

That's really a tough question. We should assume a specific distribution
of the "breaking position" (probably uniform), and see on average which
solution is more efficient, and by how much. This is not an easy problem.
Even from a qualitative point of view, the binary search solution tends
to lose a lot in some specific positions, since if the ball breaks the
search has to be stopped, but tends to be pretty good in others because
of the nature of binary search. Which one is better is difficult to tell.
Maybe, because of the problem that if the ball breaks the binary search
can't continue, another solution might be a mix: instead of a fixed
amount, increase it, making it square every time. Something like
positions 4,8,16,32,64...
 
A

Andrea Desole

Chris said:
That depends on knowing the specific difference between the weights of the
heavier and typical rocks. It is not clearly stated in the problem definition
that you do have that information. The phrase "(Say 1.1 kg instead of 1 kg.)"
sounds like an indication of the /kind/ of difference ("small but not tiny"),
rather than a statement of the actual number.

Typically vague/incomplete requirements specification...

:)
To me it just meant "for example all the heavier rocks are 1.1 kg heavier"
Another problem that the customer hasn't thought through is how you are
supposed to prise a rock off any of the piles all. Being infinite massive, the
piles' gravity would be something of a problem, as would their natural tendency
to collapse forming black holes.

oh well, in that case you can come up with several questions:

- where are these infinite number of rocks coming from? There must be a
very big mine somewhere
- who can take the time to collect an infinite number of rocks?
- who can take the time to weight them?
- if the rocks are of the same material, and some are 10% heavier, they
will probably be 10% bigger. Can't you just spot them?
 
I

Ingo R. Homann

Hi Andrea,

Andrea said:
yes, but that's the worst case.

Yes, but in every second case (the probability that the ball breaks on
floor 1-50 is 0.5 when the probability is equally distributed) you need
a linear search from 1 to 49. And this needs in worst case 49 tries
(avg. 25).

My worst case is 20! And the average is 10. (If my calculations are
correct.) I think, this is hard to top.
That's really a tough question. We should assume a specific distribution
of the "breaking position" (probably uniform), and see on average which
solution is more efficient, and by how much. This is not an easy problem.
Even from a qualitative point of view, the binary search solution tends
to lose a lot in some specific positions, since if the ball breaks the
search has to be stopped, but tends to be pretty good in others because
of the nature of binary search. Which one is better is difficult to tell.
Maybe, because of the problem that if the ball breaks the binary search
can't continue, another solution might be a mix: instead of a fixed
amount, increase it, making it square every time. Something like
positions 4,8,16,32,64...

I dont agree: In binary search, you need to halve the *remaining*
interval in every step. You do the opposite.

Of course you are right that binary search is not the proper solution
for this problem - but this is no argument for your algorithm.

The more I think about it, the more I think that my idea is optimal:

Do some kind of "linear search" on 10,20,30,40,50,...,100 with the first
ball and then (if the first ball e.g. breaks on 40) a linear search on
31,32,33,...39 with the second ball.

That's O(sqrt(N)). I think you cannot get any better.

Note that the cost measure I used is the number of tries you drop a ball.

A better cost mesaure might be the number of stairs you have to go
(which should approximately be linear to the time you need). With this
new measure, a different algorithm should be better (I explained how to
"parallelize" my algorithm - but of course that is not optimal as well).

Ciao,
Ingo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,007
Latest member
obedient dusk

Latest Threads

Top