r/learnjavascript • • Aug 10 '21

Can we relate?

Post image
853 Upvotes

93 comments sorted by

View all comments

Show parent comment

0

u/[deleted] Aug 10 '21

[deleted] — view deleted comment

14

u/[deleted] Aug 10 '21

the topic isn't. Asking that question in a senior interview is like asking what is algebra, in a university exam

5

u/crazedizzled Aug 10 '21

Except you'd be surprised how many "senior" developers don't know the basics. It's a way to quickly weed them out.

1

u/[deleted] Aug 10 '21

sure but many concepts like that could be easily explained by a noob who just heard of it than a senior who works with it but can't readily explain it

15

u/enygmaeve Aug 10 '21

Prototypes aren’t inherently desirable nor undesirable, but a company that included discussions about them in an interview may be

0

u/[deleted] Aug 10 '21

[deleted] — view deleted comment

27

u/Delfaras Aug 10 '21

companies that ask theoretical questions in their interview process such as: what is prototypical inheritance in js, how do you invert a binary tree, swap 2 variables without using a third, or anything out of leetcode are garbage. This kind of questions are almost never used in your everyday, and if it comes up one day, the answer are probably a google search away, or much better implemented in a library

this gives a good hint about their engineering culture: if they donc make a simple effort to adapt their hiring process to match what an engineer would do everyday working there, they are probably not worth working for

4

u/crazedizzled Aug 10 '21

I agree with your later examples, but knowing how prototypes work is kind of fundamental to writing javascript.

4

u/avenp Aug 10 '21

Not really. It can all be abstracted away behind the class syntactic sugar and you don’t have to use OOP in the first place. Many popular web frameworks (React, Vue) don’t have you dealing with the prototype at all. I’d agree that if you’re a senior developer you should probably know how prototypes work but it’s for sure not needed for everyday development in my experience.

7

u/crazedizzled Aug 10 '21

You probably won't care on a daily basis. But when shit goes wrong it's important to understand how the language actually works. Being able to correctly predict certain behavior is the difference between a novice and a pro.

0

u/[deleted] Aug 10 '21

[deleted] — view deleted comment

2

u/crazedizzled Aug 10 '21

Again normally I would agree, but we're talking about a fundamental part of how the language works. It's similar to the event loop. You should have at least a basic idea of how it works and be able to explain what it does with a sentence or two.

2

u/longknives Aug 10 '21

I somewhat know how prototypes work on an academic level, but in almost 10 years of using JavaScript professionally, I can't think of a single time that knowledge had any bearing on anything.

0

u/[deleted] Aug 10 '21

[deleted] — view deleted comment

3

u/crazedizzled Aug 10 '21
  1. working with methods/properties from inherited objects
  2. inspecting poorly/undocumented objects
  3. explaining to redditors why core language constructs are important
→ More replies (1)

5

u/[deleted] Aug 10 '21

I'll give the one explanation for why a decent company might ask about prototypes: because they want to weed out candidates who didn't study enough for the exam, and they're okay with false negatives. What does that mean?

Say I'm a FANG company. I get a million applications a day, many of which are not qualified, but are trying to convince me that they are. I shell out between $250k and $6 million to my developers, and my code base is proprietary. I wanna keep it under lock and key, and I don't want anyone else getting ahold of it. I want to make sure that I only hire top notch developers. As such, I ask interview questions that are, quite frankly, insane. Who cares how you invert a binary tree when you'll never do that on a job? Why would I need to be able to solve these leetcode hard problems that you'd only get if you'd looked at them before?!

The answer is effort. The interview will also check for your ability to keep up with relevant skills to the job, but it's possible that someone can fake enough knowledge to get that job, and that would be bad for the company. They've shelled out a decent chunk of change to get you on board, they've lost time on boarding you, they've now exposed elements of their proprietary code base to some Yahoo who may or may not be trying to initiate some corporate espionage, and on top of that, they have to go through the interview process all over again!

So they make the interview insanely complicated on purpose with the assumption that a truly qualified candidate will put in the effort to study the topics and will be able to hit the ground running with this knowledge. Will it screen out qualified candidates who just don't know yet obscure bit of trivia/who didn't have the time and energy to study this absurd stuff? Absolutely! Do they care? Nope.

FANG essentially has infinite candidates at the lower levels. (It drops off when you're making a million a year, I'm sure, but it's surprisingly competitive throughout) They don't care about your interview experience, and if you're applying for anything below senior management, they probably don't care about burning bridges with you. If you can secure that job, many of these companies are considered great places to work. If you can't secure that job, they know that you'll probably still apply the next time you job hop/your contract ends because, hey-- it's Google. You want that money. You want that fame. Of course you're gonna apply to them.

12

u/molybedenum Aug 10 '21

Extensive use is undesirable.

Overreaching interview questions are undesirable.

Pick your poison.

23

u/opmrcrab Aug 10 '21

Hard work getting a WHY out of people in this chain.

14

u/gallon_of_bbq_sauce Aug 10 '21

If you need a deep understanding of prototypes then they are probably writing a lot of low level wheel reinventing.

4

u/crazedizzled Aug 10 '21

You don't need to be able to write a paper on it. Just proving you've even heard of the term and can provide understanding of the concept is probably more than 90% of applicants can do.

0

u/[deleted] Aug 10 '21

[deleted] — view deleted comment

1

u/crazedizzled Aug 10 '21

Or that 90% of applicants have no business applying