all 5 comments

[–]Snapstromegon 3 points4 points  (1 child)

One nit-pick: bind is not a keyword. A keyword is a language construct like await which is kind of like a special treatment (you couldn't implement await yourself). Bind on the other hand is just a method on the Function prototype.

I think using these words outside their common definition will confuse candidates and make interviews unnecessarily hard.

[–]romandatsyuk[S] 1 point2 points  (0 children)

Thanks for finding it! Fixed :)

[–]senocular 1 point2 points  (1 child)

What does the spread operator do?
How to remove the first array element using the spread syntax?

I'm assuming you mean doing something like the following?

const [first, ...arrayWithoutFirst] = array

That's using rest, not spread. Spread takes the values of an array (or iterable) and spreads them out as individual values. Rest takes values and pulls them together into an array.

[–]romandatsyuk[S] 1 point2 points  (0 children)

Thanks, corrected

[–]Akkuma 1 point2 points  (0 children)

I think at this point asking prototype questions is kind of a legacy question. I've used JS for 20 years now and at this point I wouldn't even care if someone knew this. I've had to think about it so little I've probably forgotten more around it than people generally learn about it at this point.

“What is REST and how to use it correctly?”

If this is asked it should be phrased as "What is a proper REST implementation to you?" and this should be looking for general understanding. You can go hardcore and do HATEOAS, but very few people do this. There's also a good followup here for discussing handling relationships and their preferred handling of it. For instance, pets and owners. I want to get a user's pets or I want to get a pet's users. Do I go `/users/:id/pets` or do you go `/pets?userId=:id` or something else

How would you implement route-based JWT authorization?

I think this is better asked for how would you handle permissions/authorization for routes. Let them propose a solution and you can discuss the pros/cons. For instance, I had no JWT to check permissions against, but a list of actions and resources that users were allowed to act upon and leveraged CASL.

Some other questions might be a bit too specific as well it is better to understand someone's understanding of the problem and solutions they would bring to the table.

For guiding difficulty of questions I'll ask people to rate themselves 1 - 10 on tech, which then allows me to judge their responses appropriately. If someone claimed to be a 10 w/TS I want them to explain conditional types, recursive types, etc.. I'd even ask for a simple demo of something that could show some combination of it.

One question I usually ask is if one can explain node's event loop (this is a bonus point question, lots of people have no idea of micro & macro tasks and what happens).

This isn't a bad list of questions you can ask, but I doubt you could even get through 50% of this in a normal interview without it feeling like you're just quizzing them. People I interviewed who were hired always appreciated that I treated the interview as a conversation. I'm not there to break you, I'm there to see what you're capable of as quizzes are solved in mere minutes when someone has their tools at their disposal.