Skip to content

Instantly share code, notes, and snippets.

@ivorpad
Last active May 9, 2025 17:09
Show Gist options
  • Save ivorpad/64741adb446646ffa5c62ca7ef082fd5 to your computer and use it in GitHub Desktop.
Save ivorpad/64741adb446646ffa5c62ca7ef082fd5 to your computer and use it in GitHub Desktop.
{
"data": {
"analyzeVideoById": {
"videoID": "250c4ef3-114a-4709-8fdc-3419d48f8908",
"overallInterviewScore": 83,
"questions": [
{
"questionText": "So I have here this get active users with cat function. This function, it, it's taking, uh, a set of users. So each user, it's, it's represented by an object. Each object, um, has name, is active, and has cat as properties, right? So the idea is that we can return the correct set of users, uh, but with these two conditions: the users needs, needs to be active and also has a cat. Those two conditions. Okay?",
"answerText": "Okay. Okay. All right. So (clears throat) this, uh, we're gonna use the filter, uh, method from the array. Uh, so we're gonna get a user and we're gonna filter only the ones that is active and user as cat. So I think this should do it.",
"analysis": "The answer is clear and correct. The interviewee identifies the use of the filter method and specifies the two required conditions (active and has cat). The explanation is concise and demonstrates a solid understanding of array filtering in JavaScript.",
"answerScore": 90
},
{
"questionText": "In this case, we have this create new user. Uh, don't worry, you don't have to implement anything here. Uh, I just want you to tell me two things. The first one is, tell me what type or, or what kind of argument is that function taking? And the second thing is, explain the different syntaxes we have here. For example, this equal sign and this triple dots. Okay?",
"answerText": "Okay. Um, so this function is taking an object as an argument, and it's, uh, destructuring. Um, and it's using this equals some name here, this is, uh, uh, a default value. If name is undefined, it will assign this, uh, uh, value to that property, and active that, that can be, uh, undefined. We're n- we're not doing anything with this. And this is spreading the rest of the properties of the object on the argument.",
"analysis": "The answer correctly identifies object destructuring, default values, and the rest operator. The explanation is accurate and covers both requested aspects. The answer is clear, though a bit hesitant in delivery.",
"answerScore": 87
},
{
"questionText": "We have this person class, which is a very simple class, right? And in line number nine, what we are doing is trying to instantiate a new object of that class. For that reason, we are parsing this name and this age. The question is, what is missing inside the class to be able to instantiate this object properly?",
"answerText": "Uh, it's missing the constructor for this class, um, on JavaScript you need to provide this constructor function- ... to initialize it. Otherwise, it will use the default one that you have in there, which is an empty string and a H as zero. Yeah.",
"analysis": "The interviewee correctly identifies that the constructor is missing and explains its purpose. The answer is concise and accurate.",
"answerScore": 90
},
{
"questionText": "If we run this code, uh, it will print start, finish, and timeout. That's wrong. The correct order- ... would, the correct order would be start, timeout, and finish. The idea is that you can fix the order, but you have to use promises. That's the only condition, using promises.",
"answerText": "Okay. Uh, so the first thing is that we need to return a promise in here, uh, let's just do... We're gonna return new promise, and if I'm not mistaken, there's this reject and resolve. Um, and then console log, and then we gotta resolve it. I think this, this, this is going to work now. If you, if you want start, timeout, and finish. (clears throat)",
"analysis": "The answer demonstrates understanding of promises and their use to control asynchronous flow. The explanation is a bit informal but shows the correct approach to fixing the order of execution.",
"answerScore": 82
},
{
"questionText": "In this line, what we are trying to do is change the new object contact email value to this new email value. Okay? The question is, what are these console logs printing and explain why?",
"answerText": "Mm-hmm. Um, both are going to print new email, um, I think, um, i- it does because the objects get copied by reference, um, in JavaScript.So this ob- this o- object will copy, uh, this one but then the contact, it will still be the same 'cause it's another object. So I think it will print new email, um, but I might say I'm not completely sure because of this nested object, but I'm pretty sure it will keep the reference to this object. Yeah. That's my answer, (laughs)",
"analysis": "The answer is mostly correct: the interviewee explains object reference behavior and how nested objects are shared. The slight uncertainty expressed is reasonable, but the technical explanation is accurate.",
"answerScore": 85
},
{
"questionText": "Do you know what- what is an event emitter? And just give me an example of one of them or- or a library that we can use for- to use event emitters.",
"answerText": "Yeah, basically they're just, um, they're like, uh, an object that emit events (laughs) that's kind of, like, redundant, but it basically works that you attach listeners to this emitter, um, and once the emitter sends an event, all those attached listeners will get fired with the event. Um, we can find those on the DOM, for example, when you attach, uh, an event listener to a HTML button, you can- ... use the add event listener multiple times, and that's- that's kind of like a- an emitter. So when you- ... click it, for example, you can- ... receive that event. Um, I think, uh, Node has a- a- a package built in it called Emitter. I- I don't remember exactly, I haven't used it, uh, in a long time. But- but yeah, they're- they- they- they are packages on NPM, uh, that you can use also, uh, to handle event emitters.",
"analysis": "The answer provides a clear explanation of event emitters and gives both DOM and Node.js examples, though the Node.js example is a bit vague (should be EventEmitter). Still, the core concept is well explained.",
"answerScore": 80
},
{
"questionText": "Do you know any- any example on- on the Node side?",
"answerText": "Um, I think, uh, Node has a- a- a package built in it called Emitter. I- I don't remember exactly, I haven't used it, uh, in a long time. But- but yeah, they're- they- they- they are packages on NPM, uh, that you can use also, uh, to handle event emitters.",
"analysis": "The answer is somewhat vague and does not mention the correct class name (EventEmitter), but acknowledges the existence of such functionality in Node.js. The lack of specificity reduces the score.",
"answerScore": 65
},
{
"questionText": "Do you know why was arrow functions introduced into JavaScript?",
"answerText": "Um, if I can remember, it was because, um, one thing was the- the scope of the, this- ... uh, keyword on JavaScript. So every time you- ... created a function, uh, you were changing the scope of the this, uh, keyword. So with, uh, fat arrows, uh, it doesn't change the context, so- ... it keeps the- the parent function context, so that was one. And I think it... because one-liner functions (laughs) look, uh, a lot better. (laughs)",
"analysis": "The answer correctly identifies the main reason for arrow functions (lexical 'this' binding) and adds a secondary benefit (conciseness). The explanation is clear and accurate.",
"answerScore": 88
},
{
"questionText": "In- in NodeJS, how do you debug a, an application in the- in development environment?",
"answerText": "Uh, you create it, uh, you start the application in debug mode, and you can connect to it through Chrome, uh- ... to the- the debugger, the Node debugger basically, and you can see it kind of like it was JavaScript on the web, uh, but it's through Chrome.",
"analysis": "The answer is correct and describes the process of starting Node in debug mode and connecting via Chrome DevTools. The explanation is concise and accurate.",
"answerScore": 90
},
{
"questionText": "I just want you to tell me what happens when this express route handler gets- gets called.",
"answerText": "Mm-hmm. Yeah, um, so line eight, you declare a content route from the express app, and then you try to read the file, and that is on the same directory of that file, and then you- ... append the content, that JSON, so you're trying to read content JSON on the same directory, basically. Um, once you get the data, uh, uh, it runs code that throws an error, so that's an- that's not good. I think we need to check if there is an error, um, present, then we throw the error, and if it's not, uh, we can send the data on the response object. The other thing is that this try-catch is not going to do, I think, a lot, because you're using the callback, uh, mode for the filesystem module. Um, but yeah, it's basically trying to send the content JSON, uh, content back to the client.",
"analysis": "The answer demonstrates a good understanding of asynchronous error handling in Node.js, correctly noting that try-catch does not catch errors in callbacks. The explanation is thorough and accurate.",
"answerScore": 92
},
{
"questionText": "What- what you're saying is that- is that this try-catch does not catch the error?",
"answerText": "No, it will not catch the error- ... if an error occur.",
"analysis": "The answer is correct and direct, confirming the previous explanation.",
"answerScore": 90
},
{
"questionText": "How this can be implemented in NodeJS, and what APIs would you use to achieve this, and what things you need to- to watch out for?",
"answerText": "Mm-hmm. Yeah, uh, the first thing is, to watch out is for this header. I think all of the browsers in this header when they try to access media on the server, which is the range header, so we need to- ... watch for that. After we have that one, um, uh, we need to... Basically they ask us for a range of bytes on a, on a file. So when we read, we, we need to parse that range and we need to figure out, uh, the file size and, and then we need to read that file but at specific, at the specific range that the browser is asking for, so we don't read the whole file. So it goes into how you call it, like, uh, like in a streaming mode. We gotta handle the correct HTTP codes, which is partial content, if I, uh, remember correctly. Uh, so we wanna keep the connection open there. Um, and I think, yeah, there's a couple of other headers that we need to send back, which I don't remember exactly, but basically you need to specify, uh- ... what's the size of the file. That kind of stuff.",
"analysis": "The answer demonstrates a strong understanding of HTTP range requests, streaming, and partial content responses. The explanation is detailed and covers key implementation points, though it could mention specific Node.js APIs (e.g., fs.createReadStream).",
"answerScore": 88
},
{
"questionText": "Can you write a synchronous code inside the uncaught exception even called back and explain why yes or not.",
"answerText": "Hmm. Damn, that's a good one. Um, I don't think you can. Uh, I will assume because that's just the end of the... well, when it's a, an exception. I would assume not, but I'm not exactly why not. I haven't encountered this in the past, so, but I will say no, you cannot. Um, I've never seen it before. (laughs) Um, but yeah, I, I don't know exactly why not. And I, I'm probably wrong, but I will go with that one. Yeah, I don't, I don't- ... think you can, you should write asynchronous code on this function. Uh, I don't know, probably can generate more codes. Um, more, more errors, uh, but I'm not sure if that's the correct answer.",
"analysis": "The answer is hesitant and lacks a clear technical explanation. The interviewee admits uncertainty and does not provide the underlying reason (that asynchronous code scheduled in 'uncaughtException' may not execute as the process is about to exit).",
"answerScore": 55
},
{
"questionText": "How do you provision a server to handle these arbitrary large peaks in that server?",
"answerText": "Hmm, what's, what does it say? Pace dock and then edit? Um, I will... There's probably some, uh, database, right? Or a lot of... uh, oh, it's mostly certain that it has to either with the database rights and reads that, that, uh, route it's handling or if it's that I will s- I will, I will go with trying to optimize the query. Um... The other thing that I can think of, it's probably, um, third party appli- uh, apps that we're using that they can be, uh, I don't know, taking a lot of time to resolve. And the last thing I can, can, that I will debug, uh, would be that if we're, uh, making expensive tasks on that controller, and then we need to use some kind of queue to relieve those, uh, kind of like an off, like a worker background, uh, job that does the heavy lifting and- ... so it doesn't clog the, the, the server.",
"analysis": "The answer covers several relevant strategies: optimizing database queries, considering third-party dependencies, and offloading heavy tasks to background workers. The explanation is thoughtful and demonstrates good problem-solving skills.",
"answerScore": 85
},
{
"questionText": "How do you, um... Yeah, let's suppose, uh, it's, it's a heavy lifting stuff. How do you proceed in that way?",
"answerText": "Mm-hmm. Um, so first off, uh, we need to see, uh...... on the background, and it's listening, uh, to events. It can be from, from Redis, for example. So when the route hits, uh, that and it's time to do the heavy lifting, you just, uh, send, uh, kind of like an event that we, okay, we need to process this big file, this big task. And then just resolve the, the route with kind of like a progress, uh, or like a new job ID. And then the, the broker, the wor- the worker takes over and then he just do it on the background and can take whatever they want.",
"analysis": "The answer describes the use of background workers and job queues, mentioning Redis as a broker. The explanation is clear and demonstrates practical knowledge of scalable server design.",
"answerScore": 88
},
{
"questionText": "Do you know what's the difference between, uh, authorization and authentication?",
"answerText": "Mm, yeah. So I think, and I think they call it auth N and auth Z. So basically, au- uh, authentication is when you're trying to prove, uh, that you ha- uh, have wha- that you are a certain person. You can do this with your email and passwords, so that's, uh, authentication. You're proving yourself that you are this person with this email. Um, and authorization comes when this user, this actor tries to do actions on the applications, but we wanna authorize that this, uh, actor has permissions or access to certain resources on the app. So those are the distinctions.",
"analysis": "The answer is clear, correct, and uses appropriate terminology (authN, authZ). The explanation is concise and accurate.",
"answerScore": 92
},
{
"questionText": "What are the, what are the ways, uh, we can store credentials of an authenticated user? No, no. Store. Store. Store.",
"answerText": "Export? Oh. So, what I've done in the past is that you basically have, uh, uh, two columns on a database which are email and then a password, which you hash. Um, so when the users try to authenticate, uh, they send their email and their password, you try to find the email, and then you match the password. There's a library called bcrypt, what I've used in the past to match those passwords if they match. Um, we can use JSON Web Tokens, um, to store that data, the, the- ... the data that the user, uh, provided and send it back. And then on each request, they can send back this token and we can verify it and see that it's valid, that it's not expired, uh... I think that's, uh...",
"analysis": "The answer covers password hashing and token-based authentication (JWTs). The explanation is practical and demonstrates good security awareness.",
"answerScore": 90
},
{
"questionText": "What would be the ways we could implement up-level caching?",
"answerText": "Mm-hmm. Up-level caching. Um, one of the ways, it could be in memory. (coughs) Uh, you need to manage that cache. When something updates, you need to update the cache, the memory. Uh, it can be... I never use it, but I know that there's a service called Memcached. You can cache whatever you want there. Um, the other thing that I can think of is Redis which can serve as a, as a cache too.",
"analysis": "The answer mentions in-memory caching, Memcached, and Redis. The explanation is correct and demonstrates awareness of common caching strategies.",
"answerScore": 88
},
{
"questionText": "Do you know what's the difference between imperative and declarative programming paradigms?",
"answerText": "Mm... Yes, but I, I've, I don't remember exactly how to explain it, but let me try. Um... And I, (laughs) I think I always write it, uh, declarative, but I don't know. I'm probably writing it declarative. Um... I don't remember. (laughs)",
"analysis": "The answer admits uncertainty and does not provide a clear explanation of the difference between imperative and declarative paradigms.",
"answerScore": 40
},
{
"questionText": "Do you know, what are, what are mocks?",
"answerText": "Yes. Um, so when you're trying to test an application, um, sometimes you wanna control the, the, the tests or the cases. So in those cases you use mocks to, uh, kind of force some service or some, uh, function that return what you want in order to test it. So you mock it. That's how you...",
"analysis": "The answer correctly explains mocks in the context of testing, describing their purpose and use. The explanation is clear.",
"answerScore": 85
},
{
"questionText": "How can we improve this function's performance?",
"answerText": "Mm-hmm. Mm-hmm. Um, we can use, uh, memoization. Uh, so basically which is kind of like- ... uh, caching, uh, the value. Uh, so if you have the, the same arguments, you can... since it's pure, uh, you can assume that it will return the same, uh, value. You can, I think, memoize the function and the values so it doesn't, uh, take alone- ... on all those places that it's being called. Yes.",
"analysis": "The answer correctly identifies memoization as a performance optimization for pure functions. The explanation is clear and demonstrates understanding of the concept.",
"answerScore": 92
}
]
}
},
"extensions": {
"invocations": {
"analyzeVideoById": {
"executionId": "d0f31r3ivvvm4g1o80j0"
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment