DEV Community

Discussion on: JavaScript Interview Question #17: Sum of Two Empty Arrays

Collapse
rkennela2 profile image
Ryan Kennel ๐Ÿถ

I do not want to work at a place that asks me something that wonโ€™t be needed on the job and can easily be googled

Collapse
coderslang profile image
Coderslang: Become a Software Engineer Author

The question is not how easy it is to google something. The point is to check the depth of your knowledge.

With this specific question, the interviewer will determine your skills in:

  • type conversion in JS
  • loose equality operator
  • conditional statements
Collapse
rkennela2 profile image
Ryan Kennel ๐Ÿถ

I appreciate the interesting tidbit of information but itโ€™s not useful to determine the effectiveness of the dev.

I am much more interested in their understanding of OO and functional programming concepts, ability to test drive JS, yarn/npm, frameworks...

Thread Thread
akashkava profile image
Akash Kava

Dev trying to debug an error for couple of hours just because he doesn't understand how concatenation works, is basically waste of company's money and time. A small mistake can lead to unexpected consequences and delay in achieving deadline. Multiply number of such mistakes with the number of devs who do not know such details, the penalty is a huge. And this penalty is actually paid by entire company, every developer in the company because no one will have time to calculate such small mistakes.

Thread Thread
rolfstreefkerk profile image
Rolf Streefkerk

You may put importance on what can be learned, i would be put importance on what someone understands. Anything can be learned and questions like these do not test if someone has the capacity to learn, but rather what he can memorize or has had experience with.

Thread Thread
akashkava profile image
Akash Kava

I believe if one has not learnt the basics in college/graduation, educating an employee isn't responsibility of an employer unless employee is ready to compensate the pay for learning. This has nothing to do with memorizing, memorizing is knowing each properties of elements of periodic table.

Thread Thread
rolfstreefkerk profile image
Rolf Streefkerk

you seem to think that everyone should have learned these "basics", then you live in fairy tale land.

This is about memorization and not about understanding principles and showing the ability to understand those principles and apply them.

There's a difference here between knowing something and understanding. What you're asking for is that people know, what I'm more interested in is if they understand it.

Collapse
andreidascalu profile image
Andrei Dascalu

No, the question itself doesn't check the depth of knowledge unless you state it such that it requires the detailed explanation as part of the answer.

Otherwise, it goes like this: JavaScript is a loosely typed language that performs lots of magic type conversion. Something empty generally does equal false, so does the sum of two empty things? It's a safe bet to say yes.

Thread Thread
coderslang profile image
Coderslang: Become a Software Engineer Author

You're absolutely right. But the issue is that most wannabe Junior devs wouldn't understand what you just said. What I'm trying to do, is to get them thinking a bit deeper than the regular "crash course" curriculums.

And the question absolutely requires an explanation. Otherwise, everyone has at least a 50% chance of success here.

Collapse
zacharythomasstone profile image
Zachary Stone

Okay cool.

Collapse
brunooliveira profile image
Bruno Oliveira

While this is interesting to see how some things in JS work, it's really not adequate from the point of view of ensuring that the developer knows anything useful for the job. That should be the goal of the interview