Live data from Hacker News

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

news.ycombinator.com

11–13 of 13 posts

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

#11
post #6

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

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...

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

#12
post #11
post #6

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

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...

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.

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

#13
post #12
post #11

Earlier quoted context omitted.

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...

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.

A tree?? I can't see any tree.
Post reply on HN