DEV Community

loading...

Discussion on: You're not worth hiring unless...

Collapse
vanduc1102 profile image
Duc Nguyen • Edited

I interviewed some guys. They could not solve the add 2 arrays integer challenge in their favorite language. I gave thumbs down on them... Sad.
the challenge
addArrayInt([1,2], [9, 0]) => [1,0,2]

Collapse
omrisama profile image
Omri Gabay

What the hell even is this question?

Collapse
olamidehimself profile image
olamidehimself

😂😂😂😂

It's probably for data analysis

Collapse
r7e98kva profile image
Markus

I also don'tget the answer 🤔
Regarding the name I'd expect [10,2]

for(int i=0;i<a.length;i++) {
result[i]=a[i]+b[i];
}
return result;

Unfortunately I don't work as a developer, it's just a hobby 😟

Collapse
vanduc1102 profile image
Duc Nguyen • Edited

it is for handling big integer add,
if you have 2 numbers:
for example: 123123123123123123123712931290 + 987837298748923749823749823749238472 = ?

you have 2 big arrays of digits represented 2 big integers, we want you to do the ADD operator into a single array.

Thread Thread
derekanderson profile image
Derek Anderson

Your original post didn't say "an array of big integers" nor as of the time of writing this was it updated. Waste of my time. Are you sure they didn't know or said I don't want to work here? :)

Collapse
derekanderson profile image
Derek Anderson

WHY?

Isn't it more important to listen to their approach to solving the problem? You clearly can't expect any candidate to "everything" you know.

Collapse
andrewbrown profile image
Andrew Brown 🇨🇦 Author

I will come to the correct solution but if the process to the conclusion is not the same as the interviewer then it's invalid. I remember I had an algorithm challenge which I think was a multidimensional array where you had to count the occurrences of 1s scanning the rows and the scanning the columns.

The senior interviewer kept interrupting me because they thought I was down the wrong path and we're trying to lead me to the solution thinking like a comp-sci.

Their production server during the interview had was down and the senior interview left and and I was able to continue down my own process where the junior interview did not interrupt and I solved the problem with a lower space complexity than what they were expecting.

I tend to break down problems to their smallest components and then assemble the answer. To me its like cleaning your desk before getting to work. So it appears I'm doing busy work or refactoring instead of just working with what's there.

Collapse
vanduc1102 profile image
Duc Nguyen

hi, sorry for leaving any confusion,
here is the challenge and solution: geeksforgeeks.org/add-two-numbers-...

We are actually using a code editor online like hackerrank, where the challenge is very detail with sample...

the challenge is aimed to check if the candidate has a skills to manage code , variables , loops etc.

Collapse
andrewbrown profile image
Andrew Brown 🇨🇦 Author

This is the result you want

Input : n = 3, m = 3
        a[] = { 1, 2, 3 }
        b[] = { 2, 1, 4 }
Output : 337
123 + 214 = 337

Input : n = 4, m = 3
        a[] = { 9, 5, 4, 9 }
        b[] = { 2, 1, 4 }
Output : 9763

There you go

def join_array_sum a, b
    a.join('').to_i + b.join('').to_i
end

I know this is not what you want, but I know a CompSci grad can regurgitate the solution in minutes. However, it turns out to be a poor indicator for hire because then I have to spend 3-6 months teaching them AWS, how to probably commit a feature to a repo, how to work with a web framework.

Honestly, just want people meeting business objectives. There are hundreds of books and online solutions where if and when you need to you can produce this result when needed.

I needed OpenCV to crop the whitespace out of a photo so I put my co-founder on it. He never used python, his background is not web-dev (network engineer), he had it working in 30mins.

I put a comp-sci grad on it and they couldn't get it working with a full week timeline. Yet they can solve these puzzles. Make sense of that.

Thread Thread
rossdrew profile image
Ross

I put my co-founder on it. He never used python, his background is not web-dev (network engineer), he had it working in 30mins...I put a comp-sci grad on it and they couldn't get it working with a full week timeline. Yet they can solve these puzzles. Make sense of that.

Easily. Your co-founder has a wealth of experience and time served in a wide variety of tools, techniques, libraries, patterns, shortcuts, blockers, research techniques and the graduate has a fraction of that an no understanding of what corners are ok to cut. This is exactly the result you would expect. Why it makes no sense to you, makes no sense to me.