>> After the initial call or even during the initial call, towards the end, or maybe it might be a separate call, you might get a series of prescreen questions. Usually these are the larger companies that wanna kind of vet you out before you get started, because interviewing someone takes resources, it takes manpower.
[00:00:35] What is the difference between const, let, and var? Anybody?
>> More on that?
>> Yeah, yeah [LAUGH]
>> Var is global, generally. Let is a little bit more narrow, and const is fixed. You'll get yelled at by some JS lent rule if you try to change it later.
>> Okay, that was okay.
>> So have that each other. It was okay. Scope is a good way to finding it. Var, I wouldn't say is global, its global to whatever scope it but it's not gonns leak outside. But yes, const, it's not immutable, people say it's immutable, but we probably have different definitions of immutable.
[00:01:19] You can't point a const to a different pointer. But you can modify that, you can add objects, or you can add properties to an object, things from array. We can't change that pointer. Let, you can change the pointer, but it's only gonna be scoped to whatever the closure is.
[00:01:33] And var is hoisted to the top. So const and let, if you try to access them before they're gonna throw a reference there, var will just throw undefined. Pretty simple. These aren't trick questions. It's just how fast and how comfortably do you answer these questions? Okay, there are wrong answers, but there aren't as many wrong answers to this.
[00:02:09] Anybody, anybody at all.
>> I just did.
>> [LAUGH] All right, what's a prototype? Nobody, this is funny engineering. All right, nobody. Yeah, take a shot.
>> I'll take a shot. So when an object inherits from another object, if that object that it inherited from has some functions or properties, this new object, it will have those.
[00:03:03] The analogy I usually use, it's not the best one. It's pretty good, is parents with children. Do you have one parent with brown eyes, you have another parent with brown eyes. The child could have brown eyes, or it could over write it and have blue eyes, something like that.
[00:03:30] Don't guess. If you're guessing, that's pretty easy to tell. And a lot of times with these questions, if it's a recruiter or things like that, they're not necessarily super well versed in UI engineering, they might be, you never know. But they're gonna have kind of a general answer, and they're looking for something that falls in that range.
>> It's the current scope you're in which can change and if there is no scope, that is the global window, object usually?
>> Perfect answer, exactly right. I considered the global context of everything that is available to access.
[00:04:14] So all the objects and functions are available to you that are not locally defined. Yeah, and if you haven't thought about this kind of high level abstract questions, yeah, that's okay. That's what this course is for. What's the data structure of the DOM?
>> Yes, it's a tree, that's it.
[00:04:35] [LAUGH] Again, not a trick question, just have you thought about this before? What is a stack? It's a data structure, right, yeah.
>> LIFO, FIFO. Last in, first out versus first in, first out.
>> Which one is which?
>> Stack is LIFO, cue is FIFO
>> Yes, LIFO, FIFO, Last in, First Out is the stack, First in, First Out as a cue.
[00:05:04] Think about if you need a mental model. You're standing in line, that's a cue. The first person that gets there's first one that leaves if it's a fair line Stack is, it's reversed. It's like you get line and then actually it's people in the back that go first.
>> Bulk and bush with work for Stack.
>> Yeah, it is an array pop and push shift. Yeah, how can you tell if an image element is loaded on the page? This one is a little more nuanced but there's an onload element of Images You can just say is it on, has it loaded?
[00:05:55] It'll fire that call back. All right, what are call() and apply()?
>> It's a way to call another method, but usually use it if you have to change the scope you're calling with. I can't remember which is which [INAUDIBLE] I put.
>> I never can either. That's okay.
[00:06:11] All I would wanna know on this question is their ways of changing the scope of the calling function. Yeah, and call is a series of arguments and applies an array of arguments. Nice, we don't necessarily need to apply as much anymore, because we have props or we have array spreading, things like that.
[00:06:29] But it'd be good to know. What is event validation? So traditionally, if you have event handlers in HTML, you could apply an event handler to every single element you wanna have. Or using event delegation, you could say I wanna have one event listener, and that's at the top.
[00:06:47] And when you click on something, it just bubbles up to the parent that handles the event. That's an event delegation. I would want someone to know this cuz event listeners are really expensive on a page cuz every time it renders, gotta be like did something happen? Did something happen?
[00:07:52] But in general, I would expect everyone to know these questions off the bat, just kind of pop them off. Again, not looking for precise correct answers. I just want that they have some knowledge of what they're talking about. But importantly, why I didn't ask is I didn't ask trivia questions.
[00:08:26] We'll hack the news. I'm gonna ask that to somebody. Is that relevant to the job? If they know that, does that inform you of anything that they can do other than they know some trivia questions? So if you're the interviewer, don't ask trivia questions. Ask questions that you know.
[00:08:39] I see what I'm gonna face, its's even real close, real closer, closer. You're probably thinking your interview is easy, but that's because you already know the answers to them, that's it. That's my big rat. Everybody says my interview, my questions are easy. My Christian questions are easy, my interviews easy.
[00:09:00] That's cause you already know the answer. If you didn't know the answer, would you be able to solve your own interview questions? Probably not, if we're being honest, probably not. If I'm being honest, I've asked questions that I wouldn't even know the answer to right off the bat.
[00:09:15] If so, is that a valid interview question? This is something I really want us to take seriously as an industry. Don't ask trivia questions. Don't ask weird algorithm questions that aren't relevant. Ask questions that you would know the answer to or is necessary in your day to day working.
[00:09:31] That's not much to ask, right? That was the application, the initial call. That was a lot. That was a lot of information already. CATSA process interviewing is a grind, it's about stamina, it's about endurance. And as the interviewer, what I wanna do is I wanna make that process as easy as possible.
[00:09:51] Interviews are not gonna be easy, rhey're never gonna be easy. They shouldn't be easy. We get paid a lot of money for we do, but at the end of the day I'm not like bruised or bloody and sweaty. Maybe my back hurts from eating too much free food as I'm leaning over my computer.
[00:10:06] But at the end of the day we get paid a lot of money to do what we do, interviews should not be easy, they should be fulfilling. Interviews should be like a first date, pretty awkward, a little challenging, you have to put your best face forward. At the end, do you think if it works out, you're yeah, that was really satisfying.
[00:10:24] I think we got to know each other. I think I wanna continue on this journey with this person. There you go on a second date. That to me is what a interview should be. It should be challenging and rewarding at the same time, but it shouldn't be frustrating.
[00:10:36] Not too much to ask, right?