

Why asking complex low-level algorithms in a Java job interview? - quaiks

I can&#x27;t understand why I am asked to resolve some tricky&#x2F;stupid&#x2F;unreal algorithm using Java in a job test. I am missing something?? I know that the code has to be as efficient as possible and the pragmatism is cool and so on.<p>I just think that what Java is looking for is getting away from all of that. And there are a lot of better solutions for this kind of jobs like C, or even R.<p>I think the nature of the problems to solve in Java are not related with this complex algorithms. I mean, I have been training myself in generics, OOP, SOLID principles, Clean Code, Design Patterns, TDD, BDD and some others for the last three years.<p>How I am supposed to show my skills in one hour resolving a low level algorithm in a web IDE (this particular case)? All my &quot;low level thinking&quot; is pretty oxidized.<p>Maybe I am just wrong. A novel speaking.
======
Someone1234
Because programmers love to be huge dicks to one another and it is
unfortunately widely supported behaviour in the community.

In no other field is it really acceptable to ask a candidate to solve issues
that have nothing to do with the job, I liken it to asking your prospective
surgeon how they'd fix a leaking faucet, or a plumber how they'd repair a
ruptured artery.

However I am most definitely in the minority, most programmers thing it is
perfectly fine and normal that you have to study obscure CS curricular
whenever you apply for a programming job. Then never ever use that same
material again while at that job.

Sorry you had to interview at a dicky company, just do what I do, reject them
as somewhere you want to work and move on. It speaks volumes of the atmosphere
(e.g. unrealistic expectations, treating people badly, arrogant/pompous
employees, etc).

------
jms5180
It really depends on the company and your role.

If you are entry level, I can see testing you on this since it should be fresh
in your mind from school and you probably know nothing anyway.

If you have been coding for 5-6 years doing annotations and configuration
heavy java code. Chances are you remember nothing and will need to study up.
To me, this is completely useless and if your job doesnt entail doing this, I
have no idea why they ask these questions.

I think what would be a far better option would be to ask you a few algorithm
questions, give you a packet to study, then invite you back to test again.
Because in my mind the biggest indicator of success as a programmer is the
ability to learn new things in a short period of time.

I think this is why companies like google still ask these questions (in
addition to being a remnant from the times when every developer at google
worked intimately with complex data structures) is that they want to see if
you can learn it. I don't think anyone there has delusions that anywhere close
to 100 percent of their accepted applicants knew this stuff before the
interview process, but again I think they want to know if they can learn it
quickly

~~~
quaiks
Good answer. I need a week for getting all my low-level tools sharpened for
this kind of job. But I don't want this kind of job so.. Done.

------
wonderb0lt
I don't think it has to do with Java in particular, but rather with testing
your algorithmic and problem-solving skills in general

~~~
quaiks
Yes I totally understand but I think the nature of the problems to solve in
Java are not related with this complex algorithms. I mean, I have been
training myself in generics, OOP, SOLID principles, Clean Code, Design
Patterns, TDD, BDD and some others for the last three years.

How I am supposed to show my skills in one hour resolving a low level
algorithm in a web IDE (this particular case)? All my "low level thinking" is
pretty oxidized.

Maybe I am just wrong. A novel speaking.

~~~
Zergy
How are you supposed to demonstrate those skills in an hour doing anything?
The only practical way to determine high level skills, such as the ones you
listed, is through studying past work. The company has probably already formed
an opinion on those skills and is testing to see how well rounded your skill
set is.

------
solomatov
I often ask on interviews about binary search and hash tables. These are
things which we use very often in libraries, and aren't that complicated.

~~~
quaiks
Arrays.binarySearch(...) And for a more in deep knowledge, Google. This is
what I expect from a Java programmer.

Hash tables... Hashtable vs HashMap? Classic one.

------
bjourne
Can you give an example of what low-level algorithm you were asked to
implement? Otherwise it's hard to say either way.

~~~
quaiks
Integer array. Applying the next rule, How many jumps are necessary for
getting out of the array? Return -1 if never gets out.

A[K] = M -> jump to -> A[K+M] = L

I don't know If this is enough for understanding the problem.

It's not complex but my solution is going to suck. BTW they like it...

~~~
bjourne
I think it is, and I have to disagree with you. I think it is a very
interesting puzzle for candidates. The array is basically a tree A[K] and the
jump is a pointer to its parent node. If the jump is out of the array, A[K] is
a root. Your task appears to be to find the max depth of the graph or return
-1 if it contains cycles.

~~~
quaiks
A tree?? I can't see any tree.

