Комментарии:
This is great! Props to Eli for pushing past the nervousness and settling in, it must've been extra hard for him knowing it was going to be recorded and uploaded to YT. I would LOVE more of these! I'd also love to volunteer to do a mock interview with you (me as the interviewee), if you'd like. I might not be quite at the point I'd need to be YET but I'd still love to do it!
Ответитьafter watching this video 1 year later I want to tell Eli that he will be a very cool engineer!
ОтветитьThese were interesting questions. Here's what I came up with, each solution is only one line.
For Q1:
const myString = 'Hello World';
console.log(Array.from(myString).map((str, idx) => (idx % 2 === 0 ? str.toUpperCase() : str.toLowerCase())).join(''));
OUTPUT: HeLlO WoRlD
For Q2:
const badHtml = '<div>Hello<div><div>Nice to meet you<div><p>Also works with other tags<p>';
let i = 0;
console.log(badHtml.replace(/<(\w+)>/g, (match, grp) => i++ % 2 == 0 ? `<${grp}>` : `</${grp}>`));
OUTPUT: <div>Hello</div><div>Nice to meet you</div><p>Also works with other tags</p>
Hey Nader & Eli,
Thank you so much for this detailed interview.
Just a question for Nader.
How long did it take for JS concepts to really cement in your mind and you be able to just draw from memory/learning?
I am 6 months in to JS and some concepts are still a bit hazy while others have solidified
Thanks !
We need more of these
ОтветитьThis guy is me in an interview 😅 I wish the company could just hire me to work for free so they can see how I do since I am not good with interviews
Ответитьidk why I'm here as a 0 trying to understand what is being talked about in here. I am in college in a general studies major and I'm curious about getting into the computer science, more specifically, software engineer with a side of cybersecurity (blue/red hat) interests. The issue I find myself in is this: "Do I have a passion for the topic?" well... I honestly don't know. I don't really conceptually understand the ideas of passion because I don't really feel any passion for anything. Maybe I do but I don't see it? or maybe at the very least recognize it? I don't know... very cool video though, I watched it to the halfway point to easy section, because I don't know these terminologies! lol don't want to overload myself too quick, I will get burnt out. Awesome to see this practice being done.
ОтветитьYo… if i answered all answer with ease and precision, can i potentially get an IT job?!
Ответить3rd div tag shouldn't be closed on the last test case. But hats off to Eli! Great job!
Ответитьstring question my attempt:
function cap(s) {
return s.split("").map((x, i) => i % 2 === 0 ? x.toUpperCase() : x).join("");
}
I appreciate this so much! Thanks Eli for your vulnerability. I hope this opens more doors for you. 😊
ОтветитьThis is an example of someone who did not re-read his notes, or doesn't have notes to begin with, you should always study writing concepts in your own words and study that hard, because its information your brain created, so it's easier for you to recall, also, you need more confidence here, you should know what your tools are and what they are for, imagine if you asked a baker about how ovens work and he doesn't even know that they store heat. Short concise answers will give you the job, if you don't get it on the first try... nobody does, just study, know your shit and go on confident that you know your shit, and if you don't study harder and try again. BTW, I'm a software developer who started his career at 35 and started school at 31... and if you ask me what an array is, I would simply say, A mechanism to temporarily store sequential indexed repeatable objects.
Ответитьbro on left is kinda hot ngl
ОтветитьWhat else can he do with an array?🤔
ОтветитьEli, you have my utmost respect for this. Even though you know it is technically not a real interview, you put forth your best effort and explained your process in an incredibly easy to understand way. I'm also 29 and moving into the web development side of things.
ОтветитьI have done the last question sir but it was some large and confusion approach for the problem.
i just did it by counting number of div's and halfed it and again by comparing and decreasing the other count..... finally it worked but i don't think it is a good approach that i have done sooooo... Does the interviewer like's that or he gonna ask to short the code?
Even though it was a great interview 💯.
You just put that guy in a full of stress and tension that i to felt that 😨
im doing now 10 months f full stack developer and now we are on JavaScript, I feel like a complete idiot, but that is alright. And this video even I couldnt follow it was nice to see the thinking process on how take you problems on. I'm very gratefull for this. Greetings from Belgium
ОтветитьI have not yet done a coding interview at all 😂 and still got the job. This is good to know in my future jobs
ОтветитьProps for the guy doing it. The only piece of advice I would give is to be patient with yourself. If you don't know something...it's truly ok to say hey I don't know that specifically...but here's what I do know...and how I can use that to figure it out. Where a lot of people fail in interviews...is they try to sell skills they don't have and comes off as a salesperson rather than a subject matter student.
ОтветитьThanks for the good website hosting knowledge! Ive skilled GoDady and HostGator, but Cloudways with TST20 couppon is the best cash saver.
ОтветитьEli - great to be you. You demonstrate an 'interested oriented' mindset; dopamine driven, with limited patience. Great for dev - when focused/hyperfocused. Suggest stimulant evaluation - though likely you've tried before
ОтветитьRofl, JR Dev interviews be like : Given an array of integers, write a JavaScript function that efficiently finds the single number that appears an odd number of times in the array. You must solve this using bit manipulation (specifically bit shifting). Assume that there is exactly one such number and that all other numbers appear an even number of times...and have 3-5 years experience for this shit tier paying job.
ОтветитьWtf did I just watch, done all questions in 10min. well everyone starts somewhere 😆
ОтветитьI followed along on the last question, and here's what I ended up with, who knows if it's good or bad /shrug lol
const fixDivs = (input) => {
let counter = 0
let inputArray = input.split('')
return inputArray
.map((value, i) => {
if (inputArray[i] === '<') {
const tag = inputArray.slice(i + 1, i + 4).join('')
if (tag === 'div') {
switch (counter) {
case 0:
counter++
break
case 1:
value = inputArray[i] + '/'
counter--
break
}
}
if (`${tag}v` === '/div' && counter === 1) counter--
}
return value
})
.join('')
}
How to get to your Interview? ))
ОтветитьThanks for sharing
ОтветитьI'm new to coding so I know shit about it
For the 1st challenge,
Could we have written "i+2 = toUpperCase()"
Instead of the whole if/else loop!!?
Again, it's just something that came to my mind...so I might be wrong...I'm just learning JS
good job , the last solution still has a bug the final answer is <div></div><p>hello</p></div></div> which is not right
Ответитьtoo much relatable
Ответитьconst f = (s) => {
let arr = s.split('');
const res = [];
let isDivPassed = false;
for (let i = 0; i <= s.length; i++) {
if (s.slice(i, i + 5) === "<div>") {
if (isDivPassed) {
res.push("</div>");
i += 5;
isDivPassed = false;
} else {
res.push(s[i]);
isDivPassed = true;
}
} else res.push(s[i]);
}
return res.join('');
second question without edge cases : str.replace(/<div>\w+/gi,val=>val+'</div>')
Ответитьis the interviewer also a junior?
Ответитьsir i am a beginner, i tried to solve the second one by myself, so can you please provide me feedback and also suggestions if possible.
function closeDiv(html) {
let splitedHtml = html.split("<div>");
let closedDivArray = [];
let element = "";
for (let i = 0; i < splitedHtml.length; i++) {
element = splitedHtml[i];
if (i % 2 !== 0) {
closedDivArray.push(`<div>${element}</div>`);
} else {
closedDivArray.push(element);
}
}
console.log(closedDivArray.join(""));
}
closeDiv(
"<div><p>this is a<div>paragraph</p><div><p>this is a new <div>paragraph</p><div>another div<div>"
);
Amazing video and great job Eli!
ОтветитьThis was an amazing video to sit down and watch being a beginner learner into coding myself. Watching this whole video gave me a lot tips on how to tackle problems and how to go through it step by step to get a better understanding of the question given. By questioning/answering edge cases and giving examples of what you want the program to actually run/spit out. I, myself, never really went through this process and just went straight into the coding aspect and try work my way through that which made it really hard on me, decreasing my confidence.
I give huge props to Eli because he came into this mock interview not prepared at all. You can tell Eli was nervous by the way he laughs and how he moving around a lot and wasn't really still at first. But after seeing you giving him the guidance and patiently talking to him through the process, Eli became more a lot confident and was able to work solving the code faster by understanding it.
The first coding problem was was done beautifully and I was able to understand it every step of the way. But the second coding question became a lot hard to follow due to the second if statement and understanding where to put each variable within the various brackets. My brain would always explode when I see more than 20 lines of code and would constantly have to run myself through the code repeatedly to understand it again.
Also, I really enjoyed on how Nader kept a calm/cheerful mood when talking to Eli even after seeing his nervousness when working through the problems by giving him reassurance on how he can approach things whenever Eli was stuck. I feel like I, myself, would have a better understanding If I had someone I can talk to and ask a lot of questions if I ever get stuck on how to approach things or ask how certain code works.
UwU
Ответитьhere's the solution i came up with for the second problem:
function closeDivs(html) {
// start by finding all the locations of <div> tag in the string
const divIndices = [];
let index = -1;
do {
index = html.indexOf('<div>', index+1);
if(index !== -1) {
divIndices.push(index);
}
} while(index !== -1);
// now we can interate over all our indicies of <div>,and insert '/' for every second div
let arr = Array.from(html);
let indexOffset = 0; // splice will modify array, every time we do this we need to insert the next one space further
for(let i=0; i<divIndices.length; i++) {
if(i%2 === 1) {
arr.splice(divIndices[i]+1+indexOffset,0,'/');
indexOffset += 1;
}
}
return arr.join('');
}
hi.
hahah.
he is old and he is 26. What about me and I am 45 and just started learning.
Love this content. Gives us aspiring developers an idea of what to expect in a real interview!
ОтветитьWow! So helpful! Thanks
ОтветитьIf the questions were like this in the current market interviews, I would have smashed them like coconuts
ОтветитьI like how the interviewer is supportive
Ответитьfunction closeDiv(html) {
let correctedStringHTML = "";
let yesFounded = false;
for(let i = 0; i < html.length; i++){
if(yesFounded){
if(`<${html[i + 1]}${html[i + 2]}${html[i + 3]}>` === "<div>"){
correctedStringHTML += "</div>";
yesFounded = false;
i = i + 4;
continue;
}
}
if(html[i] === "<"){
if(`<${html[i + 1]}${html[i + 2]}${html[i + 3]}>` === "<div>"){
yesFounded = true;
correctedStringHTML += "<div>";
i = i + 4;
}else{
correctedStringHTML += html[i];
}
}else{
correctedStringHTML += html[i];
}
};
return correctedStringHTML;
}
closeDiv('<div><p>hello there<div></p><div><div><p>hello<i><div></i><div>');
in just five minutes
No one is talking about how Nader has manly deep sweet voie
Ответитьif opening and closing tag are correct normaly the code let some thing correct !!
it seeems you consontrate oly an the second ones...
tell me if im wrong..THANKS
there are a mistake ....
look you see the opening div has a slache ( / )!!!
it s not correcte bro because the modelus of ........
you see the </div></div> at the end..REALY STRANG
How about this for the first question?
`string.split("").map( (el, i) => i % 2 === 0 ? el.toUpperCase() : el.toLowerCase ).join("")`
Or if you don't want to lowerCase then
`string.split("").map( (el, i) => i % 2 === 0 ? el.toUpperCase() : el ).join("")`
Also, would you have benefited from `charAt()` in your for loop?
This is what I needed to see this gives me a peace of mind
Ответить