Тэги:
#javascript #coding #learn_javascript #learn_coding #web_development #nodejs #programming #learn_programming #full_stack #learn_to_code #learn_code #learn_js #js #intro_to_js #js_intro #web_dev #web_dev_intro #full_stack_intro #javascript_walkthrough #beginner_javascript #js_for_beginners #javascript_tutorial #javascript_tutorial_for_beginners #javascript_interview #technical_interview #software_interview #mock_technical_interview #mock_javascript_interview #js_interviewКомментарии:
As someone who is preparing to embark on my own technical interviews for the first time, this is an incredibly helpful resource.
Watching this mock interview is easing my anxieties and helping me overcome my strong feeling of imposter syndrome. Thank you for sharing this!
Great video, really helpful. Just curious why you want to create methods on the prototype instead of just using plain functions. This seems dangerous as it could collide with other libs that add methods to the prototype. Seems the trend is away from OOP to functional programming. Also in JS, 'this' always refers to an object, though strict-mode may modify that behavior but not sure.
Ответитьthis seem overly convoluted for a junior mock interview. Playing around with prototypes in this manner and creating things that already exist in JS ie map, flatten etc seems really odd.
ОтветитьThis was too good ! (no pun intended)
ОтветитьI think it is not a good idea to use String.prototype.isPalindrome and Array.prototype.myMap it will cause a lot of problems which is why you will never see someone using them in an interview or in a project. instead just use a normal function like: function isPalindrome, function myMap, etc
Ответитьcool video)
ОтветитьI stopped the video in each question for find the response by myself, and the tecnifiqué part i resolved the problems by myself too and then I continued with the video.
Was very interesting!
This is probably my favorite mock. Very professional acting, knowledgeable of what he knows and doesn't but is able to express it without seeming like a bro.
Ответитьi think if you use this.valueOf() instead of merely 'this' it would work as you intended.
ОтветитьI think it's unnecessarily confusing for a Junior Level interview to use the String.prototype.isPalidrome. Just let the guy focus on the main goal of the question which is to check for a palindrome with a simple function. :)
ОтветитьI'd love having him as my interviewer... I feel sick to my stomach whenever I have live coding challenge or tech interview... I just can't think well when someone watches me :(((( I am just frozen.
ОтветитьFor the first question: Primitive values like strings are automatically converted to objects (wrappers) when you access their properties or methods. In this case, when you call a method on a string literal, JavaScript temporarily converts the string to a String object, which is why you see [String: 'racecar']. At the end, you're comparing a string literal to a string object using ===. To make it work, you can just compare values (==), or do something like, 'this.toLowerCase()', which will act on the string literal of the string object and return true. Confusing...I know.
ОтветитьThanks for the video😁
ОтветитьDSA is a BS way of determining employee value. But here. Anyone over 40 usually does poorly with these because we didn't have classes to learn, we taught ourselves. Now we are senior systems designers and we find solving these stupid puzzles ridiculous. Proves next to nothing. We hired someone who smoked all the DSA, on the job they were absolute trash. Couldn't even commit things to Git, had no idea about TypeScript, had no idea about the value of cohesive patterns. Just hot garbage hire, 9 months later, they left. DSA is a red herring at best. Libraries solve most of these, like Lodash, and if not, use AI to generate a starting point and optimize it.
These are solved here for reference. I wrote these, but only because of interviewing. Interviewing is broken. They should be asking us to build something related to the job. Not this nonsense.
O{n} version
const isPalindrome = str => {
const forward = str
const reverse = str.split('').reverse().join('')
return forward === reverse
}
The interviewer will then ask you to optimize it, which means remove the memory so O(1) version using pointers.
const isPalindromeWithPointers = str => {
let left = 0
let right = str.length - 1
for (let i = 0; i < str.length; i++) {
if (str[left] != str[right]) {
return false
} else {
left = left + 1
right = right - 1
}
}
return true
}
thank you for these videos
Ответитьthanks a lot Nader
Ответитьgreat review friends, if possible take me to work)
ОтветитьIn non–strict mode, THIS is always a reference to an object. In strict mode, it can be any value. - MDN
So you could have also used this.toString() instead of String(this)
Code question 1: The '===' operator checks for both equality and datatype. In this case, we are comparing and object string against a string, hence the equality will always return false. The fix: use '==' operator which will just check for equality.
ОтветитьString.prototype.isPalindrome = function () {
if (this.split('').reverse().join('') === this.slice(0)) { return true; }
return false;
};
Thank you for great video. It is really helpful for me. I'm currently looking for developers jobs but because of my lack of English skills, it wasn't going easy well. I'm learning English and interview skills at the same time from your videos. Thank you!
Someone already mentioned 'valueOf' though, I was thinking about 'toString()'. I'm still in the middle of the video, I will keep watching .Thank you for good contents, Nader!
---
I've just finished watching the video, Thank you for the great video! I've learned a lot. Nader is a great mentor. I hope I get a chance working with a colleage like him. I liked seeing his guide for him, and I've also learned a lot from Gavin. His attitude was really nice, and he didn't get nervous, he's just done his job very well.
In the first problem we should either loosely compare "this" with reversedString (using ==) or compare this.valueOf() with reversedString
ОтветитьI never actually had a proper JavaScript interview, but your video demonstrates an accurate level of interview would be liked. It definitely nudged me into thinking more of a typical questions to why am I doing things in JavaScript, especially in the earlier stage of the interview questions about React, API, etc. The follow up coding interviews were very interesting. For example, if someone where to ask me about the MAP function, I should be doing ok, but coding it.... is another question.
ОтветитьCan the palindrome task be solved in this way? Would appreciate your feedback :)
String.prototype.isPalindrome = function (str) {
if (str.split("").reverse().join("").toLowerCase() === str.toLowerCase()) {
return true;
} else return false;
};
console.log(String.prototype.isPalindrome("racecar"));
The problem with this was that it's mentioned that it's a object in the docs right? That's why it was an object and we all know that everything in js is a object so when we use the String constructor and pass an object it returns the string. Let me know if you find any fault here
ОтветитьAre you sure this is for a junior position? I think it might be more suitable for a junior position at a FANG corporation. Given the salary range of 60k to 100k, these types of exercises would likely be appropriate for a mid-level software engineer.
ОтветитьI came here to hear the English language from the point of view of a non English speaker
Ответитьthanks to share this helpfull video. I think in the first code question we can just use String function (not String constructor) to convert to string and make strict check on value.
ОтветитьPalindrome question, is the solution used in the video better than iterating the string with a single for loop matching symbols from both ends of the string and breaking on the first mismatch?
ОтветитьI would love to have an interview with you Nader
ОтветитьI like these. Really having a good time watching and good imagining my future interview in this area
ОтветитьThese are extremely useful. Thanks a lot, Nader!
I'd like to suggest a video that would advice on how to get recruiters' attention, to land the interview. Seems like a real struggle.