Пікірлер

  • @abdelkrimebettayeb5509
    @abdelkrimebettayeb55099 күн бұрын

    This guy managed to switch career at this point of his life, what a great guy! Imagine how good he'd be if he discovered coding when he was young!

  • @gooseob
    @gooseobАй бұрын

    interesting interview! I have a short solution to the algorithm question ```js const longestNonRepeatingSequence = (str) => str .match(/.*?(.)(?=\1|$)/g) .reduce((acc, item) => (item.length > acc.length ? item : acc), ""); ```

  • @JadesFitnessBucketList
    @JadesFitnessBucketList2 ай бұрын

    really loved watching this, i kept pausing after the question to quickly think about what i would say and how I would write the function before Cody answered. My solution was super similar apart from i used **continue ** in my if block in the loop and at the end to find the longest str in the array i did: return strArr.reduce((longest, current) => { return current.length > longest.length ? current : longest; }, ' ');

  • @kashmyr8
    @kashmyr82 ай бұрын

    Nice video but I think the candidate overall would have failed in my book. 1. They answered all the React questions in the beginning pretty well. 2. The solution for the coding challenge is pretty much O(n^2) due to the includes nested in the for loop. The solution is not optimal and a pretty messy. 3. The react code was messy. The util method should have been brought in from another file instead of residing in the component. The util function itself should have been "pure" and should not include any React state setter methods. That should be done outside of the util method. Not knocking the interviewee at all though, it's a lot harder under pressure obviously.

  • @devzozo
    @devzozo2 ай бұрын

    I think a good way to practice would be to copy a hackerrank problems into a react app, display the result(s) in a component, then make an input for the user to see different results from whatever the hackerrank question is asking to do. That seems to be the theme for many of the early-mid level questions. Cody kept saying something along the lines of "Theres probably a better way to do this" and I think that's ok to say, but if you say it too frequently, it makes you seem less confident or qualified. You might want to reword it in a more 'impressive' way by saying something like "I would probably review the documentation to make sure this is the best way to do this...".

  • @ahntagonist7674
    @ahntagonist76742 ай бұрын

    Around 1:01:30 Justin seems to justify the usage of a "tricky" problem such as LeetCode 6. ZigZag Conversation for the sake of "seeing how an interviewee approaches a problem" or just to "weed out candidates." I think that this an extremely poor way of interviewing a people. What exactly are we testing for here with a problem that doesn't utilize a recognized algorithm like sorting or searching and isn't directly applicable to many use cases in production? Are we testing for pattern matching or the ability to simulate the physical layout or structure? Unless the applicant was applying for a job where they would be doing game development, implementing some sort of rendering algorithm or doing complex data processing and formatting asking a candidate this type of question is at best an exercise in pointless problem solving. At worst it's emotional and intellectual hazing or waterboarding that doesn't bring out the best in candidates. It says a lot of a company and the engineering culture if the interviewer busts this question out during a front end interview: cut your losses and apply somewhere else.

  • @rdnexta
    @rdnexta3 ай бұрын

    Plz decrease music volume, it's good for us to focus on discussion.😊

  • @rdnexta
    @rdnexta3 ай бұрын

    what is the name of this extention, when he typing, we saw somthing in front of that line. plz let me know.

  • @Fishamble
    @Fishamble3 ай бұрын

    This is a great video which deserves more views. Well done Cody, you know your stuff!

  • @justinmlawrence
    @justinmlawrence3 ай бұрын

    He sure does!

  • @yuliasereda5671
    @yuliasereda56714 ай бұрын

    I was wondering about your question smth llike what we get if we pass the component to another component. so, can be the answer that we will get a HOC(high order component) which get and return a component. if we use TS, so we can describe it like React.NodeChild. i'm a junior, so don't judge me please. but can it be the answer?

  • @RicardoPerez-gt1vh
    @RicardoPerez-gt1vh4 ай бұрын

    having a b2 level of english, will be deat on the tree first minute 🤮

  • @ondrejvrto
    @ondrejvrto4 ай бұрын

    My preety solution with reducer. .... Changing the condition to "actualChar === result[0][0]" gives you the second version. const longestUniqueSequention = (str) => { return [...str] .reduce((result, actualChar) => { actualChar <= result[0][0] // OR === ? result.unshift([actualChar]) : result[0].unshift(actualChar); return result; }, [[]]) .sort((a, b) => a.length < b.length) .at(0) .reverse() .join(''); } console.log(longestUniqueSequention('ABCDDDDEFGHI')); // <= DEFGHI === DEFGHI console.log(longestUniqueSequention('ABCDEFGHDDDEFGHI')); // <= ABCDEFGH === ABCDEFGHD console.log(longestUniqueSequention('ABABAABABCABAB')); // <= ABC === ABABCABAB console.log(longestUniqueSequention('ABABABABABAB')); // <= AB === ABABABABABAB

  • @justinmlawrence
    @justinmlawrence4 ай бұрын

    Awesome!! 👏🏻

  • @StivenBallshi
    @StivenBallshi4 ай бұрын

    The solution to this is wrong tho. If we had another string for example str = 'ABCDAEFGH' - the longest string here is 'BCDAEFGH'. The solution cody provided wouldn't work , so you need to check with either the substring method or charAt because you need to see if one of the characters is repeated.

  • @justinmlawrence
    @justinmlawrence4 ай бұрын

    Great catch!

  • @AAmorim1989
    @AAmorim19894 ай бұрын

    - He did not crush it, he would have been rejected. - This is not a mid level interview, more like an entry level one.

  • @justinmlawrence
    @justinmlawrence4 ай бұрын

    Great feedback!

  • @cy3889
    @cy3889Ай бұрын

    i had the same feeling, he didn't answer the basic technical questions at the start. Feels more like junior level

  • @shankarpathade6503
    @shankarpathade65034 ай бұрын

    Grate sir and very affordable

  • @andrewwall2730
    @andrewwall27305 ай бұрын

    Another great vid, Justin!. What seems like such a simple algo is nothing but. Your solution is so eloquent. Mine not so much, but would love your feedback on it when you have some time. const replaceLongestZeros = (s) => { const hm = {} for (let i = 0; i < s.length; i++) { if (s[i] === '0') { if (!hm[i]) { hm[i] = { stidx: i, enidx: i } } if (hm[i-1]) { hm[i] = { ...hm[i-1], enidx: hm[i-1].enidx + 1 } } } } let stidx = 0, enidx = 0 for (const i in hm) { if (hm[i].enidx - hm[i].stidx >= enidx - stidx) { stidx = hm[i].stidx enidx = hm[i].enidx } } return [...s].map((x, idx) => idx >= stidx && idx <= enidx ? '#' : x).join('') }

  • @andrewwall2730
    @andrewwall27305 ай бұрын

    Love your videos! Your solutions to these nasty algos are sublime. Just a mention but you could have just used flat().join('') instead of reduce. Keep em coming!

  • @andrewwall2730
    @andrewwall27305 ай бұрын

    Don't think hashmaps are necessary. Have you tried flatMap using new Set and then just loop checking if indexOf === lastIndexOf and push to array.

  • @mustafaemin7389
    @mustafaemin73895 ай бұрын

    const charCountMap = {}; str.split().forEach((char) => { charCountMap[char] = charCountMap[char] + 1; }) let mostUsedCharKey; Object.keys(charCountMap).forEach((key) => { if (!mostUsedCharKey) { mostUsedCharKey = key; return; } if (charCountMap[mostUsedCharKey] > charCountMap[key]) return; mostUsedCharKey = key; }) return charCountMap[mostUsedCharKey] I'm sure that there is a better way to do this but I have not looked anywhere so this is my best. Complexity kind of O(n*2) I guess.

  • @preslavgetov1330
    @preslavgetov13305 ай бұрын

    I would just add (based on my interview experience) that perhaps stating that you have never touched something or don't know it (in the redux/jotai question) does not really add anything to conversation other then name drop. If you don't have any knowledge to share, a simple don't know about it would suffice.

  • @andrewwall2730
    @andrewwall27305 ай бұрын

    Not sure I understand how the algorithm challenge has anything to do with react. Seems 90% of time not about react. And the code challenge was not well explained. Thought any consecutive same chars should have been eliminated in the results, but guess I was wrong.

  • @AmitKumar-cp6mx
    @AmitKumar-cp6mx6 ай бұрын

    const getLongestNonRepeatingStr = (str) => { //pointer let tempStr = ""; //current longest str; let longestStr = ""; for (let i = 0; i < str.length; i++) { tempStr += str[i]; if (str[i] === str[i + 1]) { if (longestStr.length < tempStr.length) { longestStr = tempStr; } tempStr = ""; } } if (longestStr.length < tempStr.length) { longestStr = tempStr; } return longestStr; }; console.log(getLongestNonRepeatingStr("ABCDDEFGHI"));

  • @khalidben9940
    @khalidben99406 ай бұрын

    The use of Array.includes method will affect the time complexity that will be O(n^2), nested loop so to speak.

  • @sadique_x_
    @sadique_x_6 ай бұрын

    chale i no reach!

  • @mahdijafaree5332
    @mahdijafaree53326 ай бұрын

    guys take it easy, as he said it is a MOCK interview haha

  • @moezzzz9341
    @moezzzz93416 ай бұрын

    This should work in python def uniqueWords(wordsList): hashMap = {} counter = 0 for words in wordsList: for idx in range(len(words)): currentWord = words[idx] if currentWord not in hashMap: hashMap[currentWord] = counter else: if hashMap[currentWord] != counter: del hashMap[currentWord] counter += 1 return list(hashMap.keys()) print(uniqueWords([["hello", "goodbye", "morning", "hello"], ["goodbye", "night"]])) Should return ['hello', 'morning', 'night']

  • @moezzzz9341
    @moezzzz93416 ай бұрын

    So I think this same problem is on leetcode and it's called Longest Substring Without Repeating Characters. The leetcode problem wants you to return the number of repeating characeters instead of retuning the the actual letters. For this problem you wanna use a sliding window approach. The way it works is that you would want to have a window of charaters and the moment you run into a character you have seen before, you want to shrink your window until it fits your constraint of no repeating characters. I will share the python code below which should be fairly easy to understand. This will return the length instead of the actual characters. def lengthOfLongestSubstring(self, s: str) -> int: left = 0 right = 0 maxSub = 0 visited = set() end = len(s) - 1 while right < len(s): current = s[right] while current in visited: visited.remove(s[left]) left += 1 visited.add(current) right += 1 maxSub = max(maxSub, right - left) return maxSub

  • @pavelelantsev9507
    @pavelelantsev95077 ай бұрын

    const replaceLongest = (str: string) => { const longest = str .split('1') .reduce((item: string, acc: string) => acc.length > item.length ? acc : item ); const replacer = longest.replaceAll('0', '#'); return str.replaceAll(longest, replacer); };

  • @danielwilliams487
    @danielwilliams48727 күн бұрын

    I like it.

  • @SeRoShadow
    @SeRoShadow7 ай бұрын

    Now seriously though, is this interview even junior level. I mean I figured in the first 10s that you should create an array to add chunks then sort it by length. And despite this, when I apply for a position, I dont even get an interview call, not even for an unpaid internship position. It makes me feel bad since I self-studied React 2 Yrs. My portoflio is still in building phase, but the ideas I try to execute require extensive development (Job Platform, Company Portal, ECommerce Everything) Should I copy porfolio projects and then rewrite them as my own (while still working on my own projects) , just to get to the interview ?

  • @justinmlawrence
    @justinmlawrence7 ай бұрын

    Let’s chat! discord.gg/4hmnhYpfDg

  • @natelawrence
    @natelawrence7 ай бұрын

    Thanks for recording and posting this presentation.

  • @justinmlawrence
    @justinmlawrence7 ай бұрын

    No problem!

  • @user-ex3nu5ix6h
    @user-ex3nu5ix6h7 ай бұрын

    const getLongest = (str) => { var currStr = ""; var tempStr = ""; for(let i = 0; i < str.length; i++){ if( str[i + 1] && (str[i] != str[i + 1])){ tempStr += str[i]; }else{ if(tempStr.length + 1 > currStr.length){ currStr = tempStr + str[i]; tempStr = ""; } } } return currStr; }

  • @licokr
    @licokr7 ай бұрын

    As a person who preparing for frontend interviews, it really helped. Many people talk about the question because the question may seem like focused on algorithm. I don't know if this is the best interview for the md-level "react" interview though, the point is that. This video is really helpful for me. I really appreciate it you made this video and uploaded it on youtube. Thank you very much! I'm looking forward to further mock interview videos!

  • @justinmlawrence
    @justinmlawrence7 ай бұрын

    Glad it was helpful!!

  • @fngkarp492
    @fngkarp4927 ай бұрын

    here us ny pathetic try to solve that: let str = '0010001010000101'; let startOfTheLongestZeros = 0; let count = 0; let isZerosRow = false; let max = {start:0, count:0}; const strArray = [...str] strArray.forEach((char,index) => { if(char === '1') { if(count > max.count) { max.start = startOfTheLongestZeros; max.count = count; console.log(max) } isZerosRow = false; count = 0; } if(char === '0') { if(!isZerosRow) { startOfTheLongestZeros = index; } isZerosRow = true; count++; } }) strArray.splice(max.start, max.count,Array(max.count).fill('#').join('')) console.log(strArray.join(''));

  • @justinmlawrence
    @justinmlawrence7 ай бұрын

    Awesome!

  • @casull6447
    @casull64477 ай бұрын

    Thank you for your effort Justin

  • @justinmlawrence
    @justinmlawrence7 ай бұрын

    Thanks!! 👍🏻🚀

  • @Jing0_
    @Jing0_7 ай бұрын

    Great interview!

  • @ahmedAltariqi
    @ahmedAltariqi7 ай бұрын

    I remember watching this video when it was released and I didn't understand anything at all. Now, I solved it without watching the video and I feel really happy! 😂

  • @justinmlawrence
    @justinmlawrence7 ай бұрын

    Awesome! 👏🏻👏🏻👏🏻

  • @ahmedAltariqi
    @ahmedAltariqi7 ай бұрын

    Thanks! Any feedback from you is much appreciated! function getLongestNonRepeatingSubstring(str) { let currentSubstring = ""; let longestSubstring = ""; for (let char of str) { if (currentSubstring.includes(char)) { currentSubstring = ""; } currentSubstring += char; if (longestSubstring.length < currentSubstring.length) { longestSubstring = currentSubstring; } } return longestSubstring; }

  • @duyanhcenland2044
    @duyanhcenland20448 ай бұрын

    as a self taugh i feel that its hard to organize what you need to know to get a job

  • @justinmlawrence
    @justinmlawrence8 ай бұрын

    For sure!

  • @mahmudulhasan3107
    @mahmudulhasan31078 ай бұрын

    I've learned so much from this video, and I want to thank you Justin for sharing your knowledge with us.

  • @abdulshabbir573
    @abdulshabbir5738 ай бұрын

    Loved watching through this, thanks for all these videos!

  • @user-zv6bv7eu8k
    @user-zv6bv7eu8k8 ай бұрын

    so lost as to how the function knows what the new maxLength is????

  • @foqsi_
    @foqsi_8 ай бұрын

    Cool video, but so difficult for me to listen to people say "uh" or "um" every other word. haha

  • @c-cg
    @c-cg8 ай бұрын

    const returnSingleAppearance = (arr) => { const unique = []; arr.forEach((strArray) => strArray.forEach((string) => { const index = unique.indexOf(string); index >= 0 ? unique.splice(index, 1) : unique.push(string); }) ); return unique; };

  • @c-cg
    @c-cg8 ай бұрын

    He killed it!

  • @Kreshel1
    @Kreshel18 ай бұрын

    react interview... 2 react questions and then 90% of the video a leet code exercise

  • @davronmaxmudov3972
    @davronmaxmudov39722 ай бұрын

    Thanks 😊, you save me 40 minutes)

  • @techmoo5595
    @techmoo55959 ай бұрын

    Often, one's posture when sitting can reveal their level of expertise or competence.

  • @idanatiya3925
    @idanatiya39259 ай бұрын

    The interviewer looks like Doctor who

  • @justinmlawrence
    @justinmlawrence9 ай бұрын

    Which one 🤔😅

  • @towfiq2266
    @towfiq22669 ай бұрын

    Hoping for a JR react interview, your videos are amazing.

  • @prakashsubba1373
    @prakashsubba13739 ай бұрын

    function uniqueWords(arr) { const obj = new Map(); const result = []; for (let i = 0; i < arr.length; i++) { const removeDuplicate = [...new Set(arr[i])]; removeDuplicate.forEach((word) => { if (obj.has(word)) { obj.set(word, obj.get(word) + 1); } else { obj.set(word, 1); } }); } for (let [word, count] of obj) { if (count === 1) { result.push(word); } } return result; }

  • @berndeveloper
    @berndeveloper9 ай бұрын

    I really don't like that much this kind of interviews, because in real life you have an entire world to explore different approaches to hit the best solution. It feels more stressful than a real scenario, if you ask me. Good questions though. (As feedback: Next time don't use music, most of us are listening our own music)

  • @berndeveloper
    @berndeveloper9 ай бұрын

    Sliding window, just google it guys, you will save a ton of time.