Coding Interview with Dan Abramov

  Рет қаралды 636,768

Ben Awad

Ben Awad

Күн бұрын

#benawad #react ​

----
Follow me online: voidpet.com/benawad
#benawad

Пікірлер: 1 300
@b-b0t
@b-b0t 2 жыл бұрын
the creator of redux taking so long to center a div gives me so much hope in my skills
@codeaperture
@codeaperture 2 жыл бұрын
😂😂
@youhabbo01
@youhabbo01 2 жыл бұрын
Hahahaha lol for real 😂
@gunarcom
@gunarcom 2 жыл бұрын
Ben had a shit-eating grin on his face.
@slimyslice
@slimyslice 2 жыл бұрын
😂😂😂
@nextentrepreneur9288
@nextentrepreneur9288 2 жыл бұрын
@Dyanosis He's been a senior fe engineer for years, he probably has a lot of experience with css
@stannone7272
@stannone7272 2 жыл бұрын
Dear Dan, Thank you for taking the time to meet with our team about the [role title] role at [company name]. It was a pleasure to learn more about your skills and accomplishments. Unfortunately, our team did not select you for further consideration. I would like to note that competition for jobs at [company name] is always strong and that we often have to make difficult choices between many high-caliber candidates.
@afs35mm
@afs35mm 2 жыл бұрын
"...not enough positive signaling"
@lucamantova3070
@lucamantova3070 2 жыл бұрын
We cannot provide further feedback due to company policy.
@weiss588
@weiss588 2 жыл бұрын
that *Unfortunately* it scares me everytime
@fyfoh
@fyfoh 2 жыл бұрын
Unfortunately, we need someone with 15 years of experience with React.
@enfieldli9296
@enfieldli9296 2 жыл бұрын
​@@fyfoh Heard that joke before, with different language context, can't remember which one tho...
@xit
@xit 2 жыл бұрын
Ben: There is a library called 'redux', Dan: "Hmmmm heard about it"
@xit
@xit 2 жыл бұрын
Mark: "Redux Toolkit is pretty awesome"
@nk4j272
@nk4j272 2 жыл бұрын
Also Dan: Redux? I never use that stuff
@horaciosoldman4481
@horaciosoldman4481 2 жыл бұрын
This is funny haha
@mahdimotallebi7207
@mahdimotallebi7207 2 жыл бұрын
😂😂
@mrkhoros
@mrkhoros 2 жыл бұрын
One thing I learned from this video is ... well I didn't learn anything. This guy fell short of my expectations tho.
@sbrugby1
@sbrugby1 2 жыл бұрын
The madman did it. He got THE Dan Abramov, defender of AngularJS, to come on the show.
@alimaxion2005
@alimaxion2005 2 жыл бұрын
Lol, it's React Js
@Spectraevil
@Spectraevil 2 жыл бұрын
Technically Dan himself tweeted about it. he asked random people in the world to interview him and Ben was probably one of the guys who was like yeah cool i’ll do it
@leandroamarillo3262
@leandroamarillo3262 2 жыл бұрын
@@alimaxion2005 no, hes referencing one time when Dan called out one of Ben's videos mocking Angular saying something like it wasn't funny nor good for the programming community to have that kind of videos that only cause infighting
@n8guy
@n8guy 2 жыл бұрын
How many companies would pass on Dan Abramov - THE Dan Abramov - based on his inability to quickly track down a rabbit in a contrived puzzle? This video *perfectly* captures the problems with front-end software interviewing today. Also, huge props to Dan for agreeing to do this. And for all he's given to the community. What a great guy. Also thanks to Ben. This kind of content can only improve the interview process in our field.
@fr5229
@fr5229 2 жыл бұрын
Companies don’t want a Dan Abramov. They want the kind of person who has really basic stuff memorized.
@Baaqel
@Baaqel 2 жыл бұрын
@@fr5229 i hate that you’re right
@_nimrod92
@_nimrod92 2 жыл бұрын
@@fr5229 Exactly so let those companies fail, the certain companies that are smart would snatch Dan in a heart beat.
@fr5229
@fr5229 2 жыл бұрын
@@_nimrod92 It’s not that the world is dumb and we are smart. Companies would rather have a person who’ll execute on their roadmap than unrelated things. They’re less likely to fail that way. People who can create, like Dan Abramov, would rather work for a company than make their own. Because they don’t have money.
@deanolium
@deanolium Жыл бұрын
The questions isn't really about finding a right or wrong answer, it's about seeing how they problem solve. Do they just completely shut down? Do they break the problem up into smaller steps which can be tackled? Can they work through with the interviewer to sense through the problem? That's really what interviewers are looking for on these type of questions. Of course, it is massively contrived and they can almost feel like the interviewer is trying to show off how smart they are. It's a hard balance.
@grmancool
@grmancool 2 жыл бұрын
47:18 Dan on Slack: "sorry guys meeting canceled I have to catch a damn rabbit"
@randerck2661
@randerck2661 2 ай бұрын
Not only catch but also squeeze it
@aryomuhammad8254
@aryomuhammad8254 11 күн бұрын
@@randerck2661 😭
@Nick-kb2jc
@Nick-kb2jc 2 жыл бұрын
Wow, this Dan guy really has a bright future in programming if he keeps it up. Great job.
@pratyakshyt
@pratyakshyt 2 жыл бұрын
someone is goin to get r/wooosh
@VenkatGudavalli
@VenkatGudavalli 2 жыл бұрын
Loool he made future 😂
@muhammadssempala5143
@muhammadssempala5143 2 жыл бұрын
Are you serious,?? The guy co created redux
@EgyptUnderGroundArmy
@EgyptUnderGroundArmy 2 жыл бұрын
@@muhammadssempala5143 First of all you just got woooshed, second of all Dan co-created JavaScript when he was..4? I think you mean Redux 🤣
@oskrm
@oskrm 2 жыл бұрын
Lol, he made Angularjs
@muhammadirshadhusayn526
@muhammadirshadhusayn526 2 жыл бұрын
Huge respect for this man. He just came casually and did the very honest thing, knowing that he could get possibly judged by everyone literally for the div centering thing. Imaging having Dan as your co worker, I would never leave him as a colleague.
@thesocialinception
@thesocialinception 2 жыл бұрын
when you are making millions of dollars, you tend to not care about how other people look at you.
@brett84c
@brett84c 2 жыл бұрын
I also assume Dan spends the vast majority of his time working on logic and not styling so can't judge him too much.
@bulbacode4380
@bulbacode4380 2 жыл бұрын
Now get one of the founding devs of Angular and make them do a React interview
@YuriiKratser
@YuriiKratser 2 жыл бұрын
Could you call out at least one of them?
@ChauTran
@ChauTran 2 жыл бұрын
they probably write better React code than you
@aviv657
@aviv657 2 жыл бұрын
it's a joke cause Ben jokes a lot about Angular being a shit framework
@faluhub
@faluhub 2 жыл бұрын
You can just see how excited Ben is for being able to have an interview with someone who created some of the libraries and frameworks he has used for so many years.
@zindev
@zindev 2 жыл бұрын
Man! For 3 seconds I though you were the real Bill Gates. I was like.. OMG! kkk
@parablesboltnoel
@parablesboltnoel 2 жыл бұрын
Who else here read and interpret his name as Bill Gates after seeing his picture
@mrjuniordev
@mrjuniordev 2 жыл бұрын
Pretty cool 😎
@ashatron656
@ashatron656 2 жыл бұрын
Gotta give Dan credit for this. Takes balls for a person of his reputation to get on stream an do this! 👍
@juliansoto2651
@juliansoto2651 2 жыл бұрын
Gives me hopes that anyone can be a senior dev at a big tech company these days.
@chill-_-839
@chill-_-839 2 жыл бұрын
I do think his answers lacked any technical understanding of the questions though which is weird given his job background.
@__hz__6983
@__hz__6983 2 жыл бұрын
@@juliansoto2651 If you can deliver value for sure, Dan sure has.
@anythingstudio5208
@anythingstudio5208 2 жыл бұрын
1:05 let & const question 3:15 when to use redux 6:40 What is dangerouslySetInnerHTML and when to use it 11:00 Center div 16:00 Binary Tree Question 21:05 Bonus Question 50:00 Bonus Question Best Solution
@mamenggaluh8897
@mamenggaluh8897 2 жыл бұрын
Thank you
@dv4able
@dv4able 2 жыл бұрын
👏
@kinderhero8897
@kinderhero8897 2 жыл бұрын
@franciscocamara6326
@franciscocamara6326 2 жыл бұрын
Thanks
@usmansbk
@usmansbk 2 жыл бұрын
Recruiters watching this are gonna start asking the Rabbit question because Dan and Ben did it.
@igorfv
@igorfv 2 жыл бұрын
Sometimes I forget that not all frontend/js devs are necessarily well versed in CSS. I remember the time that this center was actually a valid challenge
@inception252
@inception252 2 жыл бұрын
thats why i ride with c/c++ for a while, before applying
@inception252
@inception252 2 жыл бұрын
learning and implement dsa with weird language like js made my head spinning
@eccenux
@eccenux 2 жыл бұрын
Yeah, it greatly depends on what you are working with. And how many projects you do. In big projects sooner or later you have utility classes for most important things. Even if you written them yourself you just use them and forget what exactly was needed.
@brianruff3066
@brianruff3066 2 жыл бұрын
It wasn't that hard even in the past. If I couldn't use flexbox then I'd do it like this in CSS: html { height: 100%; } body { position: relative; background: red; height: 100%; } div { width: 300px; height: 300px; background: white; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }
@igorfv
@igorfv 2 жыл бұрын
@@brianruff3066 Yep, that was basically the solution, the only thing is that we had to use negative margin instead of translate. Also, we had to write JS to get the width/height in case it was not fixed =/
@eliseumds
@eliseumds 2 жыл бұрын
Wow, a professional mic makes so much difference. Well done, Ben!
@thesunrock
@thesunrock 2 жыл бұрын
When Ben leans back he is a bit hard to hear, whereas Dan's volume always stays stable. Personally, I prefer the latter.
@rendezvousonmemorylane
@rendezvousonmemorylane 2 жыл бұрын
@@thesunrock only u
@mlevel3041
@mlevel3041 2 жыл бұрын
The respect I have for Dan is huge. Can you see how humble and down to earth he is
@temirzhanyussupov6997
@temirzhanyussupov6997 2 жыл бұрын
This man is literally the god of JS and Ben is asking “let vs const” lmao 😂😂😂
@vexakul9536
@vexakul9536 2 жыл бұрын
And it turned out a good question to ask. He answered "I don't give a f*ck".
@adamferguson8611
@adamferguson8611 2 жыл бұрын
And he answered without a shred of arrogance.
@LuckyTechy
@LuckyTechy 2 жыл бұрын
lol a god are you kidding me. His answer to dangerouslySetInnerHtml was embarrassing.
@tlthiem
@tlthiem 2 жыл бұрын
@@LuckyTechy dude this guy is literally a god full stop, lol. people so gifted often dont even think about the easy parts to an answer, because it is to trivial to them. This guy is the head behind react, cra, redux, and hugely influencial in the entire js eco system.
@And1997Ruz
@And1997Ruz 2 жыл бұрын
@@LuckyTechy right, you probably know better. Even though you will probably never be as accomplished
@claude.detchambila
@claude.detchambila 2 жыл бұрын
Wow that's a truly special guest.
@brandonwie4173
@brandonwie4173 2 жыл бұрын
Thanks for both of you guys creating this unique collaboration content. I currently work as a front-end dev, and Ben's contents (React, TypeScript, libraries, and the list goes on) had helped me a lot along the way when I was studying to change my career as a developer. And Dan is my role model. I'm taking the course "Just JavaScript" that Dan recently released, and it's fantastic. I'm more than happy to see you both here in one vid and wish you all the best. Hope to meet you Dan in the near future as dev-to-dev if my dream ever comes true. I'll keep on studying and never stop learning :)
@nstball18
@nstball18 2 жыл бұрын
This is awesome. Thank you for making such an awesome interview with Dan. Love how Dan thought and solved the Rabbit problem.
@squishydough2866
@squishydough2866 2 жыл бұрын
What an interesting video to watch. Really appreciative to have Dan Abramov willing to share his approach and thought process, as well as being willing to stumble with things on the fly - not easy to do at all! But seeing such an expert have some of the same stumbles as I do, as well as getting insight into a possible different approach to problem solving, is really valuable. Thank you both!
@creatorsremose
@creatorsremose 2 жыл бұрын
I love Dan... I love this interview. This has helped me so much with my impostor syndrome. I've been coding all my life and always dreaded algorithm questions in interviews. This truly helped me. ❤❤
@bmejia220
@bmejia220 2 жыл бұрын
Great interview Ben. Nice job with the rabbit question. It's cool to see an experienced js developer work through this tricky question.
@knuckleup9191
@knuckleup9191 2 жыл бұрын
ben seems more nervous interviewing dan than dan is being interviewed
@FunctionGermany
@FunctionGermany 2 жыл бұрын
omg i never thought i'd see dan abramov center a div ben you are amazing, i love your style, and i also love dan and his great overreacted blog!
@emmanuelmunachi1801
@emmanuelmunachi1801 2 жыл бұрын
Great interview Dan answered every question with humility.
@federicobalboa9145
@federicobalboa9145 2 жыл бұрын
great job guys! congrats, more content like this, do a similar coding interview on react only, hooks, context and more.
@monome3038
@monome3038 2 жыл бұрын
This guy is super down to earth! And Ben thank you so much for these videos, learning a lot
@youtindia
@youtindia 2 жыл бұрын
The problem with tech interviews is that recruiters find problems like these (bunny) which are designed to gauge your thought process and instead using it wrongly to reject candidates. That's when you hear news like there's not enough talented developers, that's because you're gauging them wrong. If Dan can't solve this interview question then there's a good chance that a lot of bright minds might not be able to either, but that doesn't make them bad developers.
@Jamie-kf2vf
@Jamie-kf2vf 2 жыл бұрын
Been an engineer for 11 years and never encountered anything like this. I had a brief idea of how it could be solved, but I would probably have rambled on about it and bombed it. It's. It's not reflective of life as a software engineer.
@DauntingGecko
@DauntingGecko 2 жыл бұрын
Agree. Software developer in multiple languages for over 15 years here. Questions like this don’t really prove much - would you ask a mechanic to work through a very abstract scenario to prove they are a good mechanic? Nope. Programming is art and science…it takes time and many iterations to get to a solution to many challenges. Very rare you just come up with an immediate answer on the fly - takes hours to fully think things through before even coding some times. All this question does is show that the interviewers are novices and are likely seeking junior people as that’s what other companies do to hire their junior staff.
@Jamie-kf2vf
@Jamie-kf2vf 2 жыл бұрын
100%. The fact that Dan couldn't solve this is probably reflective of most of us here. And, also, Facebook would assess you on these questions during their process yet Dan works there and can't solve them himself so that's interesting to me. You're right though; they're gauging candidates on algs and ds that you wouldn't ever use in the day to day job. I've been in software for over 10 years and have never applied any of these dumb sorts of questions. When I was good at them I was studying them in university...11 years ago 🤣
@paulpavlinskyi4793
@paulpavlinskyi4793 2 жыл бұрын
Most of bright minds can’t under pressure of the moment.
@antdx316
@antdx316 Жыл бұрын
Some people who interview could be looking for things that aren't entirely related to the passing experience. If everyone interviewed were to "pass", the one who brings up something about say Coffee (when no one else did) wins, I made it up but hope you all get the picture.
@franson23
@franson23 2 жыл бұрын
Finished the 'Just JavaScript' course, made by Dan, about month ago. It helps me a lot, I was surprised, how many missconceptions there were in my understanding of JS. Thank you so much Dan, for this course and for your blog! Thank you Ben, for the great guest!)
@ipreet6850
@ipreet6850 2 жыл бұрын
From where can I get that course?
@saidibrahim5931
@saidibrahim5931 Жыл бұрын
can I get link of that course please ?
@LorandPalfalvi
@LorandPalfalvi 2 жыл бұрын
This was amazing to watch. I somehow had the impression that seniors or highly highly experienced programmers have no problem figuring out almost anything and that brought up some anxiety in me because I know I struggle with some aspects of programming.
@Big_1992
@Big_1992 2 жыл бұрын
No way! Loved his Just JavaScript course!! Highly recommended!! Thank you for doing this!
@spillcode9462
@spillcode9462 2 жыл бұрын
This was really amazing. The bunny question seemed really tricky. And again, it's really looking at a person's thought process that matter in those types of questions. Dan is inspiring
@user-bh6mc8pd8g
@user-bh6mc8pd8g 2 жыл бұрын
wow, it was so interest, want more videos with Abramov .
@speedstarlightspeed1
@speedstarlightspeed1 2 жыл бұрын
Thanks for the interview Ben and Dan. Really enjoyed it!
@ryan.connaughton
@ryan.connaughton 2 жыл бұрын
Loved the rabbit question. Paused your chat and had a go myself before continuing =)
@astritspanca2723
@astritspanca2723 2 жыл бұрын
Dan is the team leader I would love to have in my company
@gainadan-lucian2653
@gainadan-lucian2653 2 жыл бұрын
Great video, that bunny question was really something. When I heard the hint I thought about the same idea but the implementation was a bit different. I thought to double check each even number (skipping odd ones), and if no luck then start again but double check odd numbers (skipping even ones). Not a huge difference but I feel a bit proud of myself))
@Leo-ps4oo
@Leo-ps4oo 2 жыл бұрын
my first idea was to double check every number, that should work but checking even numbers first and odds second is better, but does not reduce time complexity, because the worst case is still the same.. am i right?
@vitorwindberg4212
@vitorwindberg4212 2 жыл бұрын
@@Leo-ps4oo That's what I thought, just checking every value twice from 0 to 99 should get the result and has an easier implementation.
@NisJrgensen
@NisJrgensen 2 жыл бұрын
@@vitorwindberg4212 Doesn't work. The rabbit starts at 2, you double check 0, then the rabbit jumps to 0 before you check 1. I do think there is a single pass solution but it is more complicated than this.
@vitorwindberg4212
@vitorwindberg4212 2 жыл бұрын
@@NisJrgensen you are right, only works if you guess the rabbits parity, but then we go back to the original solution and have to go back and forth
@mertciflikli
@mertciflikli 2 жыл бұрын
loved this video! more of this should come in the future with Dan! :D
@rakeshpk4991
@rakeshpk4991 2 жыл бұрын
Before starting the video I hit like. This will be a nice treat! 🔥🔥🔥
@Mal-wk3uq
@Mal-wk3uq 2 жыл бұрын
At first I thought this was a joke sometimes Ben likes trolling😂 , nice interview
@anthonyh618
@anthonyh618 2 жыл бұрын
This is great. Trying to figure out why watching other people interview makes me anxious...
@mozhiye750
@mozhiye750 2 жыл бұрын
:D same
@Khobalt664
@Khobalt664 2 жыл бұрын
Because we’re conditioned by our educational system to be afraid of tests? :-(
@TrainingWithKona
@TrainingWithKona 2 жыл бұрын
this is nifty. would love chapters/TOC for each question next time if you can
@ononaokisama
@ononaokisama 2 жыл бұрын
this was actually really cool to watch thank you for sharing
@jeremybuckets
@jeremybuckets 2 жыл бұрын
For the bunny question, you can do *slightly* better by doing a pass from index 1 to n-1 and then a reverse pass from n-1 back to 1. That gives you a worst case of 2*((n-1) - 1) = 2n - 4 guesses. Verifying this is left as an exercise for the reader.
@Daniel-rp4sx
@Daniel-rp4sx 2 жыл бұрын
this isn't a valid solution
@Zeegoner
@Zeegoner 2 жыл бұрын
​@@Daniel-rp4sx What about this: same solution as explained in the video, but instead, start at the center and make the reverse pass, then return to one hole prior to the center, and pass to the right. The idea being that you have a 50/50 shot at correctly guessing the side that the rabbit is in. I figure this provides the same benefit of the video's solution, namely, the benefit you get from passing through odds and evens, that is: having a 50/50 shot at correctly guessing the "side" (odd/even "side") the rabbit is in.
@rybakostis
@rybakostis Жыл бұрын
that's still O(n)
@Voidstroyer
@Voidstroyer 2 жыл бұрын
Based on my experiences with interviews: 1. Dan would have already not been considered since it took him so long to center the div. 2. That invert binary tree function would error out when reaching a leaf node, and if by some miracle you had a binary tree that didn't have any leaf nodes, it would enter an infinite loop because there is no exit clause (checking for a null node).
@eccenux
@eccenux 2 жыл бұрын
If that is really the case then the interview system is very broken ;-) 1. It was obvious Dan actually knew how to center a div in a "modern" way. Obviously you only do html,body style once per project. 2. The function would break, yes. On any tree. So in practice it would be super easy to notice and to fix. BTW trees without leafs are not trees ;-) There would have to be a cycle in the graph. I'm guessing you know that, but just in case ;-)
@merveillevaneck5906
@merveillevaneck5906 2 жыл бұрын
@@eccenux i agree with this. interviewers dont tend to hyperfocus on edge cases that are common best practice unless that it the point of a trick question
@Voidstroyer
@Voidstroyer 2 жыл бұрын
@@eccenux Yes I know that trees without leafs don't exist and that's why I used the words "by some miracle". (maybe someone messed up the code and let one of the nodes point back to the root or something, but that's very silly and would never happen.... I hope). I agree with 1. But as I said, the issue was that it took him quite long. All of my interviewers consider it as something very basic that you should be able to do in negative 10 seconds.... I live in Beijing, China by the way so maybe that gives some context as to what expectations interviewers have. It's very competitive. You need to pretty much be able to create your own operating system just to land that job where you will mostly be googling and copy pasting stuff. Also, all of my interviews are in Chinese and my Chinese is quite poor (foreigner living here).
@sqfzerzefsdf
@sqfzerzefsdf 2 жыл бұрын
@@Voidstroyer it's quite a bad interview question. what did you just write someone off for? for something that they most likely google in seconds and then move on to the actual work that you're paying them for? like problem solving, understanding requirements etc. remembering how all of these "basic" things work in every language, stylesheet, framework etc just isn't as relevant as being able to find their documentation, understanding it and actually producing good implementations. In fact why even explain it that much, a guy on the react team of all things getting written off should already explain why it's a bad interview question
@Voidstroyer
@Voidstroyer 2 жыл бұрын
@@sqfzerzefsdf It's a problem with tech interviews in general. To be honest, a lot of these interviewers don't know what to ask, so they just use something as some leetcode problem because it's easy to do it that way. Of all the interviews I have done, only a handful of them actually asked me about my prior experience (I already had 3 years of experience when I did those interviews) and out of those, a few of them let me do some leetcode style questions before the actual interview. Some of them literally ask questions such as "What is the lifecycle of vuejs", which is something that you can literally google in 3 seconds. I dislike questions that have clear googleable answers. Leetcode questions aren't bad in that they can determine how the person thinks and the process of how they solve problems. But more often than not it is the interviewer that lacks the skills to do anything with that information. I also don't like not being able to google for answers during an interview, because you use it all the time during your actual job. I think that it should be allowed. Just don't ask stupid questions to which the answer can be googled.
@alibaghban2934
@alibaghban2934 2 ай бұрын
I enjoyed the video very much. I really love both Dan and Ben and They are great to the community. Thanks for the collab guys.
@Narayanasuri08
@Narayanasuri08 Жыл бұрын
Dan seems like a top-notch dude. I wish I could have someone like him as my senior.
@tresthegoat
@tresthegoat 2 жыл бұрын
Imagine your interviewer is smiling like a maniac and laughing while you are trying to work your answer lmao
@Filipemerker1
@Filipemerker1 2 жыл бұрын
Find someone that looks at you the way Ben looks at Dan coding.
@Youraverageprogrammer
@Youraverageprogrammer 2 жыл бұрын
Thoroughly enjoyed every bit of this! 🙌
@iswissmiss
@iswissmiss 2 жыл бұрын
This interview just got me hype as hell!
@quachhengtony7651
@quachhengtony7651 2 жыл бұрын
I'm using redux for state and saga for side effects. It's pretty cool to see the people behind the tech you're using.
@filcondrat
@filcondrat 2 жыл бұрын
pretty cool to see people who thinks there is no use for this tech anymore 😀
@quachhengtony7651
@quachhengtony7651 2 жыл бұрын
@@filcondrat wdym?
@daniyalmujtaba
@daniyalmujtaba 2 жыл бұрын
@@quachhengtony7651 in second question, dan sounded like there are alot better options than redux right now to keep using it
@thesunrock
@thesunrock 2 жыл бұрын
Ben, nice interview. Would have been also nice to hear him answer more short junior-middle questions, like "const vs let", to know what experienced people like Dan would say.
@eliotlnguyen7329
@eliotlnguyen7329 2 жыл бұрын
What... this is literally the first thing they chat about.
@johnyepthomi892
@johnyepthomi892 2 жыл бұрын
wooosh!!!!??
@heroe1486
@heroe1486 2 жыл бұрын
@@eliotlnguyen7329 you seem to struggle with the words "like" and "more"
@NZXTUA
@NZXTUA 2 жыл бұрын
Thank Ben, thanks Dan! It was interesting. Waiting for the "Coding Interview with Evan You" %)
@bryanelliott9610
@bryanelliott9610 2 жыл бұрын
Awesome, just awesome Ben! Excellent job Dan Abramov!!
@mri912
@mri912 2 жыл бұрын
Watching Dan struggle with centering a div makes me confident in my front-end skills :)
@twenty9str498
@twenty9str498 2 жыл бұрын
In the last problem, you also need to check if the length of the array (holes) is even or odd. If the length is odd, you have to loop again with even indexes.
@cdlq456
@cdlq456 2 жыл бұрын
thank you, I know I was missing something because I started with an array of odd holes and the solution of the video doesn’t assure you the right answer.
@thetomking
@thetomking 2 жыл бұрын
I came to the same conclusion.
@MrThiteixeira
@MrThiteixeira 2 жыл бұрын
Or you can start at pos=0 and check every hole twice, pushing the bunny to the end. Same performance O(2n)
@thetomking
@thetomking 2 жыл бұрын
@@MrThiteixeira if the bunny is at 3, you check 1 it moves to 2, you check 1 again, the bunny moves to 1, you check 2 for the first time and you've missed it.
@szhzs6121
@szhzs6121 2 жыл бұрын
​@@MrThiteixeira you can omit pos=0. if you check 1 and then 1, then if the bunny were originally on 0, you would always catch it the second time you check 1. same for pos=n. once you do n-1 twice, you can stop searching.
@vaibhavmatere18
@vaibhavmatere18 2 жыл бұрын
Thank you for sharing this interview 👍🏻
@adamisom4295
@adamisom4295 2 жыл бұрын
Love this! :D Feedback for Ben: your audio is much quieter in this than Dan so personally, I was doing a lot of volume adjustment up/down.
@ozzyfromspace
@ozzyfromspace 2 жыл бұрын
Hey Ben, your purely intellectual bunny problem actually got me thinking about a solution to a graph problem I've been stuck on for like 2 weeks (not joking). So, thanks I guess. Also, you might find this funny but Dan inverted the tree real quick then took longer on the bunny problem. My situation was different: it took me a while to find a way to invert the tree using another method, but I solved the bunny problem in like a minute, with O(n^2) using a different method. I guess this is a reminder that if developers stick together and apply ourselves in sync, we can solve pretty much anything, given enough time. Glad to be a sub! Keep the excellent content coming, my guy 🎊🏆☮️🙌🏽
@MaxPrehl
@MaxPrehl 2 жыл бұрын
Would love to hear your rabbit solution!
@Zeegoner
@Zeegoner 2 жыл бұрын
O(n^2) is worse than brute forcing. How did you manage that? Lol
@funprog
@funprog Жыл бұрын
​@@Zeegonerif you make a 2 pass the worst case is n^2
@bos9824
@bos9824 9 ай бұрын
@@funprog You could check the each hole twice. So worst case is n+n. I don't think you can get any better than that
@alexmorgan1030
@alexmorgan1030 2 жыл бұрын
Trying to place div in the center, took almost 5min from one of the famous developer, yeah, it's better than hundreds of motivation videos ;)
@stannone7272
@stannone7272 2 жыл бұрын
this format is awesome!
@Italya3343
@Italya3343 2 жыл бұрын
Amazing video Ben!! 🌛🔥🔥💪💪👏👏 Please more videos like that brother 🙏
@yoggsoft
@yoggsoft 2 жыл бұрын
I got a rejection from a big tech company once and one argument was “not implementing let and const in my code correctly”, meanwhile THE Dan Abramov: “it depends, doesn’t matter that much”… tech interviews are broken!
@n8guy
@n8guy 2 жыл бұрын
Absolutely. Every interview is judged subjectively, based on the peccadilloes of the interviewer(s). I'm of the mind that if there is a coding exercise, I probably won't participate. But if I do, I'd like to make sure they are setting aside time for us to review the code together, so they can ask questions, not just make snap decisions based on arbitrary standards/preferences.
@LucasVieira42
@LucasVieira42 2 жыл бұрын
With all respect, I don’t think dans approach of “not caring” is good. If you only use let when you reasign, it improves readability, you can infer things without having to read the entire code.
@_nimrod92
@_nimrod92 2 жыл бұрын
Next time they pull some bs like that send them this video to shut them down.
@uncle.boonmee
@uncle.boonmee 2 жыл бұрын
dan is such an interesting person. i love the stuff he tweets that’s not related to coding
@heinhtetzaw9463
@heinhtetzaw9463 2 жыл бұрын
Like maths and music
@codingwithrudy
@codingwithrudy 2 жыл бұрын
You just made made day with this video :D and The Rabbit problem is really cool! Thanks Ben
@codingwithrudy
@codingwithrudy 2 жыл бұрын
Btw, for div centering I always just set - flex-direction: row; - height: 100%; - justify-content: center; I think it's the simplest :D
@josephwong2832
@josephwong2832 2 жыл бұрын
Awesome !!! Good to see Dan on
@emaxix7
@emaxix7 2 жыл бұрын
Dan accepted! Amazing stuff.
@D34DTH1NGY
@D34DTH1NGY 2 жыл бұрын
One thing everyone seem to miss out, you have to have an exit condition on the recursive function call, right? Like checking on node.left exists before calling the invert function, since it would just be called infinitely often
@lilithapotye1601
@lilithapotye1601 2 жыл бұрын
Yes, I was wondering about that too. Eventually the node you get would be a null
@coden3541
@coden3541 2 жыл бұрын
came to the comments section to find this!
@quinndirks5653
@quinndirks5653 2 жыл бұрын
Since he didn't check for null/undefined, the function will be halted by an error. invertTree(node.right) will never be called because an error will be reached when invertTree(node.left) recurses to the bottom of the tree and finds that it can no longer access 'left' of undefined/null. He's very close to the solution... he would surely realize what is needed if he were to run it.
@franciscov511
@franciscov511 Жыл бұрын
that is a huge mistake, I am impressed this guy(interviewer) did not care about it, one of the main features of recursion is the stop condition no matter the programming language..
@primingdotdev
@primingdotdev 2 жыл бұрын
aight, you got the subscribe Ben. Great seeing this, as someone that interviews a decent number of candidates I noticed at times I would have scored this candidate lower than his actual skill level (still an instant yes but its Dan Abramov and I would have risked losing him).
@_parassolanki
@_parassolanki 2 жыл бұрын
Awesome i really enjoyed this interview with Dan.
@kabal321321
@kabal321321 2 жыл бұрын
I solved the rabbit problem a little bit differently: I check the holes one by one sequentially starting from the 1st hole, but I stop before the last hole. I don't check the last hole at all, instead I check the last-1 hole again and then I start to check the holes sequentially backwards. If I reach the 2nd hole, then I'm 100% found the rabbit. How did I come to this solution? My idea was to take the worst case scenario: checking the 1st hole, but the rabbit is in the 2nd hole. Then I check the 2nd hole and the rabbit jumps to the 1st hole. Then I check the holes sequentially and the rabbit "follows" me until the last-1 hole. If I check the last hole then the rabbit can swap again the same way it did at the beginning. By skipping the last hole check and instead checking the last-1 hole again, I can know for sure that the rabbit is not in the last hole, otherwise with this 2nd check I would see it. If the rabbit followed me all the way, then it should be in the last-3 hole when I check the last-1 hole the 2nd time. If I start to go backwards from here and the rabbit would still follow me, then we would end up in the same hole at the next stop. But I'm thinking of the worst case here, so I assume the rabbit is running away from me at this point. If the rabbit would turn back at any point during this backwards chase, then we would end up in the same hole at one point. If I chase the rabbit all the way back to the 1st hole, then it has no place to go, but to the 2nd hole, which is my next hole that I check, therefore I don't have to check more holes.
@Italiafani
@Italiafani 2 жыл бұрын
I compared this to the solution shown on the video. I ran both solutions 100k times with a new random position on each iteration and on a set of 100 holes. Your solution found the rabbit with an average of 98.5 attempts, and the video's solution had an average of 99.6. Both solutions had a 100% success rate if anyone's wondering.
2 жыл бұрын
@@Italiafani can you check this solution with starting from the second index instead of first? I wonder if it's going to improve
2 жыл бұрын
That's exactly how I imagined and found the same solution. Glad I found you in the comments and see you already explained it better than I'd haha
@onthecodeagain
@onthecodeagain 2 жыл бұрын
Yeah this is what I was thinking!
@Serpentarious
@Serpentarious 2 жыл бұрын
i was thinking of just starting from zero and check each hole i step on twice until n-1 and if i didn't find it until then i will find it at n-1 since he jumps back because he's at the end.
@mrdoner3451
@mrdoner3451 2 жыл бұрын
By observing Dan struggle to center the div, I have promoted myself to his level in my head canon.
@brianruff3066
@brianruff3066 2 жыл бұрын
Yes, but could you have answered the other questions as easily as he did?
@mrdoner3451
@mrdoner3451 2 жыл бұрын
@@brianruff3066 No because I was being sarcastic. He is my father. If I was half as smart as him I'd be doing more complex things than centering divs. I struggle with medium difficulty and sometimes easy difficulty problems on leetcode. Help.
@Sindoku
@Sindoku 2 жыл бұрын
@@mrdoner3451 It's okay. It's not like those questions truly reflect real life anyway. They are still fun to solve and if you can do them they will get you into some very high paying roles. Just keep working at them, and eventually, you'll get promoted. To be fair, the other questions were probably easier than medium-level Leet Code problems, so you still have that going for your at least.
@JOJO_THE_PROGRAMMER
@JOJO_THE_PROGRAMMER 2 жыл бұрын
So this is a type of content I subscribed for
@0xggbrnr
@0xggbrnr 2 жыл бұрын
Loved this. Now I realize I'm not so bad. I figured this would be one of those anomalous situations where the interviewee doesn't hesitate at all, like in that one video of the genius kid who only studies algorithms/DS (with Clement).
@jdpt-
@jdpt- 2 жыл бұрын
The rabbit problem, it can be simplified down to 3 states as indexes: h, h+1, or up to h+n where h is the first index and n is the total number of holes minus 1. We can check for the rabbit at h. If the rabbit is at h, done. If the rabbit is at h+1, it can either go to h or h+2, so we check h again. If the rabbit isn't at h we know that the rabbit must be in h+1 or h+n, so h+1 becomes our new h while h is less than n. Basically just check each hole twice from the first hole, and you find the rabbit in less than 2n tries. EDIT: This assumes the rabbit can't jump from the first index to the last index and vise versa EDIT 2: This solution breaks at when the rabbit starts at h+3 as there is no first index the rabbit is forced against: | is a guess, ^ is the rabbit, & is the caught rabbit. h+0 h+1 h+2 | ^ | ^ ^ | & h+0 h+1 h+2 h+3 | ^ | ^ | ^ | ^ ^ | ^ |
@Xoskar1
@Xoskar1 2 жыл бұрын
My solution just thinking would be to check even holes twice and odd holes ones.
@MrThiteixeira
@MrThiteixeira 2 жыл бұрын
Yes! I figured it out within a few minutes: start at pos=0 and check each hole twice. If wrong on the first try, rabbit is to the right. Check again, win or rabbit is still to the right. That way you are "pushing" the rabbit towards the end Probably much simpler to code
@tobyealden7263
@tobyealden7263 2 жыл бұрын
I thought this at first too, but if the rabbit starts at h+2, you check h and the rabbit moves to h+1, you check h again and the rabbit moves to h, you check h+1 and you've missed it.
@jdpt-
@jdpt- 2 жыл бұрын
@@tobyealden7263 You'll miss it the first time you check h+1, yes, but the second time, the rabbit has to jump back from h to h+1, so you won't miss it. This is assuming it can't jump from the first index to the last index. Remember that h+2 is just (h+1)+1. EDIT I've just tried it out and yes you're correct, but it's at h+3 it breaks, not h+2. | is a guess, ^ is the rabbit, & is the caught rabbit. h+0 h+1 h+2 | ^ | ^ ^ | & h+0 h+1 h+2 h+3 | ^ | ^ | ^ | ^ ^ | ^ |
@tobyealden7263
@tobyealden7263 2 жыл бұрын
@@jdpt- Yes, you're right in that edge case where the rabbit is at h (i.e. has nowhere else to go on the second check). So instead consider you start at h and the rabbit is at say h+4. You check h, rabbit moves to h+3, you check h again, rabbit goes back to h+4, you: h+1, rabbit: h+3, you: h+1, rabbit: h+4, you: h+2, rabbit: h+3, you: h+2, rabbit h+2 - and you've missed it. The subtly is that the rabbit can jump into the hole you just checked.
@a7medev
@a7medev 2 жыл бұрын
The invert binary tree function will go into an infinite loop because he forgot the base case
@DanAbramov8
@DanAbramov8 2 жыл бұрын
Yup. I heard that if the interviewer doesn't see the mistake it's fair game.
@skeleskele
@skeleskele 2 жыл бұрын
@@DanAbramov8 lol this
@davidharris9390
@davidharris9390 2 жыл бұрын
Probably it will error rather than infinite loop, but the base case is definitely missing.
@DanAbramov8
@DanAbramov8 2 жыл бұрын
@@davidharris9390 Yeah you're right it would error (we'd read from a property of null).
@davidharris9390
@davidharris9390 2 жыл бұрын
@@DanAbramov8 That's probably the error I've seen more than any other writing JS. 😂
@ruel1983
@ruel1983 2 жыл бұрын
Thank you Dan. We love you! ❤️
@sriramkhandelwal
@sriramkhandelwal 2 жыл бұрын
Thanks for doing this Ben!
@evgeniypp
@evgeniypp 2 жыл бұрын
Well, with the bunny you can just keep looking in one hole (the best choice is the middle one - 49). Eventually it will get there. Yes, I know it’s O(Infinity), so what? 😜
@jperelli
@jperelli 2 жыл бұрын
18:38, not correct. Recursion has to be called only if branch != null, otherwise it will throw error something like "error trying to access property left of null"
@DanAbramov8
@DanAbramov8 2 жыл бұрын
Oh yea I forgot it's nullable!
@jperelli
@jperelli 2 жыл бұрын
I teached programming in university for 5 years, I ended up seeing 3 basic rules for recursion to work: 1. There needs to be a recursive call. I.e. call same function inside function you are defining. 2. The call needs to be inside a conditional: if, where, ternary op, try catch, whatever 3. The recursive call needs to have different arguments than the received, and each call should make the conditional closer to branch out of the recursive call, thus ending recursion, reaching the "base case"
@misterhtmlcss
@misterhtmlcss 2 жыл бұрын
What this tells us and should tell every interviewer is that TIs are not effective tools for finding talent. Also this was such a great kindness for Dan to allow himself the be seen as a human being. It'll have zero effect on his career but could allow much more junior developers to see themselves in a better light.
@DickerFetterSteinLPs
@DickerFetterSteinLPs 2 жыл бұрын
The bunny question is pretty similar to check mating with king and rook. If the enemy king is not aligned with yours, you do a waiting move.
@ryandury
@ryandury 2 жыл бұрын
If you've ever had "Imposter syndrome" simply return to 13:00 to watch the Dan Abramov struggle to center text on a page.
@plourenco
@plourenco 2 жыл бұрын
Can’t believe you actually asked him to invert a binary tree 🤣
@nohjrd
@nohjrd 2 жыл бұрын
His code would fail as he didn't include a base case (the end of a branch doesn't have childnodes).
@merlin6962
@merlin6962 2 жыл бұрын
@Dyanosis I would hope that by now FAANG companies know that everyone that prepared for the interview even only a little bit can easily answer that tho
@janakirammaddanala3321
@janakirammaddanala3321 2 жыл бұрын
Enjoyed it. Thanks. I think he should add break condition for the inverted tree.
@Shakas420
@Shakas420 2 жыл бұрын
So glad he agreed to do this. This was amazing :)
@Justin-fq8dt
@Justin-fq8dt 2 жыл бұрын
watching him struggle to center the div but then solve the binary tree inversion like that was surprising. he is obviously a skilled dev, im sure he doesnt write much UI
@denilsoncosta9837
@denilsoncosta9837 2 жыл бұрын
I think the solution to find the rabbit is start at number 1 and double check. for example, if the rabbit is at 0, then I select 1, the only move it has is go to 1, and then i select again 1. If the rabbit is at 2, then I select 1, if it goes to 1 i select again 1, if it goes to 3, I select 1 and in the next move I select 2 and repeat the process.
@GeordyJames
@GeordyJames 2 жыл бұрын
Double check and move forward left to right is the one solution that came to my mind too.
@gsgonzalez88
@gsgonzalez88 2 жыл бұрын
If it is alowed I think is the best solution
@erwinrodriguez8057
@erwinrodriguez8057 2 жыл бұрын
had the exact same idea! either way the array keeps shrinking.
@mohsinamjad8947
@mohsinamjad8947 2 жыл бұрын
I think it won't work Let's say you rabbit is at 3 You check 1, rabbit jumps to 2 You check 1 again, rabbit jumps to 1 but now your index is pointing to 2
@goga7301
@goga7301 2 жыл бұрын
@@mohsinamjad8947 u’re right. this solution won’t work
@swagfinger
@swagfinger Жыл бұрын
Hey Ben, this is a really nice video with Dan!
@lballguitar
@lballguitar 2 жыл бұрын
I've never heard Dan talk, but have read his writing. Seems down to earth and nice for a genius.
@bendevine
@bendevine 2 жыл бұрын
8:50: 'At Meta ... there's a match for dangerouslySetInnerHTML someone from security will be tagged on the PR for review' A lot of React's design decisions make more sense in the context of building facebook
@pouldev
@pouldev 3 ай бұрын
This made so much sense when he explained it, I will definitely suggest tagging people in pr based on what’s in the actual pull request
@victorrocha8200
@victorrocha8200 2 жыл бұрын
My approach to the bunny one (paused the video): - Say you're going up 1 -100, check the second hole twice, so if it was in the first hole, it could only have gone to the second (then you'd have found if) you didn't find it, but you eliminated the first hole, now your chances are 1/99 Keep checking the holes in order, basically cornering the bunny, but check the penultimate hole twice again.
@StraightCrossing
@StraightCrossing 2 жыл бұрын
I came up with the same idea. Probalby not the best solution, but it works lol
@victorrocha8200
@victorrocha8200 2 жыл бұрын
@@StraightCrossing it's actually O(n) too
@mohamedchalal4518
@mohamedchalal4518 2 жыл бұрын
i thought of the same thing but if bunny starts in hole 4, checking hole 1 first time, bunny could go to 3, the second time, could go to 2, then when you move on to 3, bunny could hop to 2 :(
@victorrocha8200
@victorrocha8200 2 жыл бұрын
@@mohamedchalal4518 I think you're right, there is always going to have the possibility thay the bunny can give me a slip, it just needs to be in front of me
2 жыл бұрын
Rofl that was both hilarious and super insightful!
@AnuragArwalkar
@AnuragArwalkar 2 жыл бұрын
we need more videos like these..
@freshprince633
@freshprince633 2 жыл бұрын
Full disclose, only started watching the rabbit question. Initially, I thought checking the same index twice before moving to the next one would work, but the rabbit could be on the adjacent index when we check a particular index twice and jump over to the one we just checked, and we would miss the Rabbi. Now, the terms have changed and we know the rabbit starts off on an even index. In that case, start sweeping from 0 to n, and we should catch the rabbit. If the rabbit starts on an odd index, start from 1. This is provided the array is not looping, and once the rabbit reaches each end of the array, it has to jump back.
@RobertFranksPlus
@RobertFranksPlus 2 жыл бұрын
Yes you can solve it if you check the same index twice, but start at an edge So check twice in 100.. if not found then the rabbit has to be at 99 or less Check twice at 99.. has to be at 98 or less.. etc til you find it.. Probably not very efficient but it took me less than a minute of thinking to come up with this? Am I hired? 🤩
@freshprince633
@freshprince633 2 жыл бұрын
@@RobertFranksPlus initially, I thought the same too. But it won't work. Say the rabbit is at 98 and we checked 100, no rabbit. Then the rabbit moved to 99, and we checked 100 again, no rabbit. After that, the rabbit moved to 100, and we checked 99. No rabbit. So even if we do a sweep of the array, the rabbit can still jump through. But since we know the rabbit starts on an even number, we can start on the first even number index of the array and do a single sweep and always find the rabbit because we are looking for where the rabbit is.
@RobertFranksPlus
@RobertFranksPlus 2 жыл бұрын
@@freshprince633 aah but the 2nd time we check 99 we would catch it!
@ImAfricanJesus
@ImAfricanJesus 2 жыл бұрын
@@RobertFranksPlus That works if the rabbit is trapped at the end. Say the rabbit is at 6. We check 4 and the rabbit move to 5. We check 4 again and then the rabbit moves to 4. We check 5 and the rabbit is 4th hole. The rabbit has been missed.
@freshprince633
@freshprince633 2 жыл бұрын
@@ImAfricanJesus exactly. Double checking an index is bit of a luck. But starting with an odd index when the rabbit is on odd index or even index when rabbit starts on an even number will surely catch the rabbit in a single pass (most of the time, before even completing a single sweep).
@TheChodex
@TheChodex 2 жыл бұрын
Dan: Creates Redux and works on React Also Dan: takes 5 minutes to center a div :D
@franciscov511
@franciscov511 Жыл бұрын
Regarding the rabitt problem, you can use four pointer starting from the corners to the middle (two couple of poninters) then iterate each pair of pointer until they find each other, in that way you can find the rabbit in a O(n/2) complexity, I wonder if we can do it in log(n), not sure about that
@bestjesse59
@bestjesse59 2 жыл бұрын
every-time I go to this account it always seems to be on the minute a video uploads
Beginner React.js Coding Interview (ft. Clément Mihailescu)
36:31
Ben Awad
Рет қаралды 2,1 МЛН
Dan Abramov - Bluesky, Core React Team, RSC, Strict Dom, and the more!
1:06:30
Can You Draw The PERFECT Circle?
00:57
Stokes Twins
Рет қаралды 59 МЛН
ШЕЛБИЛАР | bayGUYS
24:45
bayGUYS
Рет қаралды 604 М.
Когда на улице Маябрь 😈 #марьяна #шортс
00:17
😱СНЯЛ СУПЕР КОТА НА КАМЕРУ⁉
00:37
OMG DEN
Рет қаралды 1,8 МЛН
Dan Abramov SLAYS Frontend Interview w/ Ex-Twitch Engineer
1:20:15
Theo - t3․gg
Рет қаралды 310 М.
Why I don't work for FAANG
8:26
Ben Awad
Рет қаралды 790 М.
Technologies I used to Code My Backendless App
10:57
Ben Awad
Рет қаралды 143 М.
Software Engineering Job Interview - Full Mock Interview
1:14:29
freeCodeCamp.org
Рет қаралды 1,2 МЛН
After 13 months of building a Website, I switched to an App
7:37
Rethinking the Technical Interview
13:09
Theo - t3․gg
Рет қаралды 67 М.
A subscriber was asked these interview questions for a junior role
44:35
Worst Coding Interview of my Life
9:24
Ben Awad
Рет қаралды 148 М.
Google system design interview: Design Spotify (with ex-Google EM)
42:13
IGotAnOffer: Engineering
Рет қаралды 951 М.
Apple Event - May 7
38:32
Apple
Рет қаралды 6 МЛН
❌УШЛА ЭПОХА!🍏
0:37
Demin's Lounge
Рет қаралды 344 М.
Распаковал Xiaomi SU7
0:59
Wylsacom
Рет қаралды 2,8 МЛН