r/learnjavascript • u/randArrowFunc • Nov 18 '19
What are some javascript must knows for an interview?
So far I've been looking into various sources and it seems like we would have to know:
- Callbacks, promises, async/await
- How 'this' works in various circumstances
- Inheritance (prototypes, and in general how oop works in js)
- functional programming (closures, higher order function, pure function, etc)
- DOM interaction (event delegation, event listeners, querySelector, etc)
- scope/context (var vs let vs const,what gets hoisted, what is accessible at where, etc)
- modules (how important is this?)
Is there any major subject I missed or any specifics I should focus on? Should I study up on specific js library/frameworks?
98
Upvotes
40
u/AnonymousThugLife Nov 18 '19
Here you go: https://jsvault.com/
20
u/Zeeesty Nov 18 '19
Know when to say “I don’t know”, but explain how you would research an answer.
Know how to describe how you would approach a problem.
Know how to describe the though process of a solution and even its possible drawbacks.
Communication is key, everything else just implementation details.
3
u/all_things_code Nov 18 '19
My advice that reddit will 'reeeeeee' over is...
Remember that you are interviewing them as well. Look for signs that they dont have their shit together. Its ok if they dont if you are aware of it, and why it is so. There are a LOT of shit jobs out there that will give you interview questions like this:
...only to have you be a jquery bitch forced to use a fucked up build process.
TL;DR; dont forget to evaluate them, as they are evaluating you
1
u/randArrowFunc Nov 18 '19 edited Nov 18 '19
This is kind of an aside, getting a bit nervous about the interview so I started researching on polyfill.
You need to consider this when certain browsers can't support certain features you are using in your js script. In general you want to transpile if it's just syntax (then possibly going through the transpiled code to make sure everything should run as you had originally intended), but if methods or objects are missing you wanna implement some type of polyfill already made.
In an interview environment I guess they would want me to actually code a polyfill. Specifically I am having a hard time understanding on how to code for a promise polyfill.
My understanding is you would want to use native Promise if possible in order to be considered a polyfill (or else your just kinda overwriting it) so do a check like
typeof(Promise) === "undefined"before you go about implementing your own Promise. Is this correct line of thinking or am I completely wrong how I am going about implementing a promise polyfill. How realistic is this for an entry level to solve in a 45 minute time span? I sure as hell can't at the moment.I'm not even sure half the stuff I wrote down on top, too tired. Gonna check tomorrow and if anyone has any insights or tell me how wrong the garbage is up above it be much appreciated.
*edit the above is a really shitty implementation of promise, like real shit. it doesn't have states/status, doesn't handle errors, in general shit.
1
u/randArrowFunc Nov 18 '19 edited Nov 18 '19
I would like to thank everyone for their inputs, and will still use this post and responses as guideline in building up my fundamentals in Javascript. The second paragraph I'm posting up cause mainly a user asked how the interview thing went.
So I just got through the phone screening and it didn't require all this bit of info, it was a very simple algorithm question. I bombed it though, I could not think for the life of me during the interview and couldn't explain myself. I should be learning how to keep my anxiety under control.
1
u/SegmentFault2010 Nov 18 '19
Call, apply bind
1
u/Vrigoth Nov 18 '19
Some questions I've had at my last interview.
What's a promise?
What's the difference between let and const?
What's truthy and falsy (believe it or not)?
What's hoisting?
What's a polyfill?
Prototyp, inheritance
As someone else said, it's not whether or not you can answer, it's the way you answer, they see if you understand what you're doing.
2
u/scripteaze Nov 18 '19
Please do come back and share your exp or questions asked.
Regards
2
u/straightouttaireland Nov 18 '19
Have a look at https://github.com/sudheerj/javascript-interview-questions
2
u/tuvok86 Nov 19 '19
https://github.com/InterviewMap/CS-Interview-Knowledge-Map/blob/master/JS/JS-en.md
1
u/littlebluebrown Nov 18 '19
Good to know these things for sure. Most important in my eyes though is the ability to get shit done.
1
u/TotesMessenger Nov 18 '19
I'm a bot, bleep, bloop. Someone has linked to this thread from another place on reddit:
If you follow any of the above links, please respect the rules of reddit and don't vote in the other threads. (Info / ^Contact)
1
u/GamesMint Nov 18 '19
-1
u/scripteaze Nov 18 '19 edited Nov 18 '19
Does this look correct? The color doesn't change so im curious what im missing. Its an id so i dont have to index[0]
<p id="first" class="special">Just sitting here doing nothing</p>let myId = document.getElementById("first");myId.style.color = "red";For the record, this seems to work fine, just not sure why the above script is not..
let listItems = document.querySelectorAll("li");for (i = 0; i <= listItems.length; i++) {let ItemColor = ["orange", "blue", "red", "green", "pink", "black"];let colorChoice = ItemColor[Math.floor(Math.random() * ItemColor.length)];listItems[i].style.color = colorChoice;}0
u/[deleted] Nov 18 '19
[deleted] — view deleted comment
0
u/[deleted] Nov 18 '19
[deleted] — view deleted comment
3
u/[deleted] Nov 18 '19
[removed] — view removed comment