I had to come to the comments because until 2:34 I didn't even suspect. But when he came up with "the programming language I like to start with is CSS", I said "fk I'm really lost or this guy's trolling me"
In case anyone doesn´t understand, the important value means how it´s code is prioritized (in some cases properties collide). ! important means not important, so nothing will happen. (Apparently people don't get a joke)
artin majidi tf? at least know what you’re talking about before you try to educate someone on something lmao !important is a css property which gives the attribute it’s used upon the highest precedence so basically the joke is if you use !important you’ll always have the highest priority given the context of the joke (he was literally using css) we can safely assume he was talking about the !important attribute in css, instead of using ! as “not”
@@artinmajidi1654 !important means a lot , !importat means important, u should study css to understand it, simply it makes the code stronger so the system will do it (because it is important), i advise u not to depend on it all the time or your project will fail.
@@samuelgunter And if the data is a number and you wanna be a fancy ass you can use the mathematical method: var1 = var1 + var2 var2 = var1 - var2 var1 = var1 - var2 And just like that it's inverted :D
**at a faang interview** Interviewer: I would like you to perform the chacha slide on a binary octopus. Ben: You know I hold the world record fastest binary octopus chacha slide right?
I came back to this video to thank you. A week ago, I applied to an entry-level python job and I managed to land an interview with the company. They asked me the classic questions like "What are your weaknesses", etc, and I was bombing so hard because I wasn't confident. But then, the magical moment came. They asked me to plan out a program to invert a binary tree on a whiteboard. Thankfully, I watched this video and was able to complete the task flawlessly. The recruiter was so impressed that he recommended that I work in a senior position instead of an entry-level one. Long story short, I ended up becoming the youngest CEO of a Fortune 500 company. Thank you, Ben Awad!
"Google: 90% of our engineers use the software you wrote (Homebrew), but you can’t invert a binary tree on a whiteboard so fuck off." - Max Howell, creator of Homebrew
def InvertTree(node): if node: node.left, node.right = InvertTree(node.right), InvertTree(node.left) return node If you use python then why not unleash its true power? // with std::tie and std::make_pair, the same thing is possible in C++
8:45 If you want to impress your interviewer, you can use the more pythonic way: node.left, node.right = node.right, node.left Note that this may also cause C++ developers to hang up on the spot so use with caution.
yeah from interview experience(over 40 tech interviews) they much rather you keep to normal conventions and not take advantage of Pythonic shortcuts, youre showing you know the language but youre mossong out on proving the thing theyre looking for whoch is programmatic understanding of data structures/algos if you do this stuff always make sure to state to the interviewer whats happening behind the scenes
@@hipstergod Exactly. It's a video for fun but I saw a lot of people are talking about those language shortcuts. I hate today's algo interview but a lot of people are indeed misunderstanding the "original purpose" of those questions. You can use those shortcut after explanation or show them the not shortcut version. They want to know your understanding of basic data structures/algos. Believe or not, a lot of people can do some fancy `filter()` `reduce()` functions to solve the problem with 1 line but don't know how to use a simple for loop to achieve the same thing. When you need to do some specific optimizations with your own for loop, this is the key why those questions are designed. Many terrible/slow apps have some filter(map()) like combination code to deal with some simple problem behind the scene, end up has O(n^2) - O(n^3) without concern. Unfortunately, 99% of algo questions are over complicated due to the markets, hot trends, salary, population, even H1B, etc. I believe the result of the bar rising is a complex problem behind the industry.
@@doc8527 yyeeess, I use Python for my interviews. its my first language and perfect for interviews but using Pythonic shortcuts are so much cancerrr. I hate going to leet code or hacker rank and seeing people throw 1 line solved and theyre so complex in that one line that no one else unless they know the shortcuts will understand, completely destroying the whole point of teamwork
@@dscham1507 Yup. The comma on the right builds a 2-tuple out of the right and left values. The comma on the left pattern matches against sequences of length two and assigns the values it finds to the left and right attributes. It works because the entire expression to the right of the equal sign is evaluated before any of the assignments on the left occur.
Your explanation of swapping left and right was actually very welcome. I made the mistake of not using a temporary variable when I wrote my first swap function and I could not figure out why it wasn't working!!!
8:05 best explanation of screwing up swapping. Btw can we use (Node.left, Node.right) = (Node.right, Node.left)? Edit: It works, you don't even need to use the parentheses.
Ben, you have always been on my feed when I start watching more tech videos but I am legit subbing you after this. This is a masterpiece .. 😂😂 .. enjoyed the diss at microsoft and certain someone working there.. 🤣
I don't know if you all knew that but in python you can literally write- a, b = b, a this will switch those two and it's really nice and not very known
I'm currently trying to self learn, HTML and CSS were a breeze, JS on the other had is a little more tricky. Anyone have some tips or suggestions to help me out with JS retention/ learning?
Important facts, made even better with the cedar waxwing cameo at the end. Those birds get drunk on berries, that's probably why they want to get inverted.
Love it, recommended to my A Level CS students. Left arms frequently get chopped off. I'm concerned that some won't get the humour, but hey, that's life in the big city.
Not gonna lie I was actually impressed when you inverted the whole google doc
hahah emas
u ll become a fine interviewer
🙃
Rotated
oot em
Because you've never used transform before or because you don't know how to open dev tools?
Some poor kid is gonna watch this and recite it in an interview.
I'll do!!!!
I was planning to -
the show must go on ^^
I had to come to the comments because until 2:34 I didn't even suspect. But when he came up with "the programming language I like to start with is CSS", I said "fk I'm really lost or this guy's trolling me"
Shouldn't I? I thought the bird imitation could get me the job
Alt F4 to open dev mode, a yes a professional.
I almost fell for it
Ctrl. Shift I or F12 or Ctrl. Shift J bruh
It actually closed the browser window for me.
Joke's on you. That didn't get me because I'm on a Mac.
@@31redorange08 yeah, that's what it's suppose to do rofl.
I was going to give you a *Hire* decision, but the bird imitation at the end convinced me that this was worthy of a *Strong Hire*
noice
Noice
He owes those birds a thorough inverting 🐦🔀🔻
my man
Ayy the algoexpert
I died at "The language I like to start with is CSS"
Well, CSS *is* Turing complete, soo …
@@JaycenGiga its dependant too..
well, CSS is a language
Hahahahahhaa same 😂😂😂
@@monad_tcp HTML too. It's in the name Hyper Text Markup Language
"This is bound to make you stand out ..... !important" I'm dying
In case anyone doesn´t understand, the important value means how it´s code is prioritized (in some cases properties collide). ! important means not important, so nothing will happen.
(Apparently people don't get a joke)
@@artinmajidi1654 are you on crack?
@@artinmajidi1654 I'm pretty sure you are confused and confusing other dude
artin majidi tf? at least know what you’re talking about before you try to educate someone on something lmao
!important is a css property which gives the attribute it’s used upon the highest precedence
so basically the joke is if you use !important you’ll always have the highest priority
given the context of the joke (he was literally using css) we can safely assume he was talking about the !important attribute in css, instead of using ! as “not”
@@artinmajidi1654 !important means a lot , !importat means important, u should study css to understand it, simply it makes the code stronger so the system will do it (because it is important), i advise u not to depend on it all the time or your project will fail.
4:38 please show the youtube stats on how many people "clicked off" the video at this point
lmao
yes please
lol
twitter.com/benawad/status/1354088279126249474
@@bawad Absolute legend! _Laughs in i3wm on arch linux_
Every time I hear :
Do you want to be software engineer at Google
I mute sound so that my friends can't laugh at me
gO To aLgO expert dot CoMm
@@Bebs_ dot io*
gEt StUcK?
Lmfao
@@DragonRazor9283 sTeP bRo! *Is your way to go*
"They're like begging to be inverted or something." lmao
I actually laughed so hard when I heard that haha
@@Unreadable69 I also laughed out loud
I don't know what's more impressive -- your coding skills, or your ability to keep a straight face while giving "advice" :D
In Python, you can actually do
node.left, node.right = node.right, node.left
and skip the temporary variable
same with JavaScript, except you have to say [var2, var1] = [var1, var2]
(replace var1 and var2 with 2 variables)
@@samuelgunter thats the cleanest array swap
@@samuelgunter And if the data is a number and you wanna be a fancy ass you can use the mathematical method:
var1 = var1 + var2
var2 = var1 - var2
var1 = var1 - var2
And just like that it's inverted :D
@@iDraKzy well yeah if you want to use extra lines and make it unclear :p
@@samuelgunter Or if you use another language than python or javascript ;p
Did y'all hear Ben imitate the birds' sound? He's secretly a bird that hates how trees look and his sole purpose in life is to invert 'em all!
**at a faang interview**
Interviewer: I would like you to perform the chacha slide on a binary octopus.
Ben: You know I hold the world record fastest binary octopus chacha slide right?
8:25 Bruh. “I’m getting a compile error” in google docs, and in python, an interpreted language😂😂
Are you implying that Ben made a mistake here? Don't be ridiculous, he's a haskell chad - he wouldn't ever make a mistake
Oh, of course, I forgot about the new pep, which allows you to compile in google docs, ben couldn’t be wrong
I came back to this video to thank you. A week ago, I applied to an entry-level python job and I managed to land an interview with the company. They asked me the classic questions like "What are your weaknesses", etc, and I was bombing so hard because I wasn't confident. But then, the magical moment came. They asked me to plan out a program to invert a binary tree on a whiteboard. Thankfully, I watched this video and was able to complete the task flawlessly. The recruiter was so impressed that he recommended that I work in a senior position instead of an entry-level one. Long story short, I ended up becoming the youngest CEO of a Fortune 500 company. Thank you, Ben Awad!
Fortune 500? That's a nice word for non-FAANG companies. Not impressed, try harder.
6:55 should be 10 spaces
Failed the interview like a chad
9:54 when you're using Angular in front of Ben Awad
"Google: 90% of our engineers use the software you wrote (Homebrew), but you can’t invert a binary tree on a whiteboard so fuck off." - Max Howell, creator of Homebrew
Glad to see the Angular jokes are back 😃😂
"18 font so we can actually see what we're doing"
Someone get this man a medal for this level of comedy
this cracked me up " whenever u look at binary tree it already looks inverted"🤣🤣🤣
*Ben Awad Exists*
Angular: 👁👄👁
Hi suboptimal
@@sainathsingineedi2922 so we meet again 😂
angularJS*, cuz angular is a different framework ;)
@@AnimusAgent That always confuses me. Which one is he talking about? He should surely know angular 2.0+ is angular and not angularjs right?
def InvertTree(node):
if node:
node.left, node.right = InvertTree(node.right), InvertTree(node.left)
return node
If you use python then why not unleash its true power?
// with std::tie and std::make_pair, the same thing is possible in C++
Now do it in c
@@vojvoda-draza I can do it in PHP
F (for the microsoft interns who bring users to VSCode by making extensions)
btw, they get paid, pretty well.
8:45
If you want to impress your interviewer, you can use the more pythonic way:
node.left, node.right = node.right, node.left
Note that this may also cause C++ developers to hang up on the spot so use with caution.
yeah from interview experience(over 40 tech interviews) they much rather you keep to normal conventions and not take advantage of Pythonic shortcuts, youre showing you know the language but youre mossong out on proving the thing theyre looking for whoch is programmatic understanding of data structures/algos
if you do this stuff always make sure to state to the interviewer whats happening behind the scenes
@@hipstergod Exactly. It's a video for fun but I saw a lot of people are talking about those language shortcuts.
I hate today's algo interview but a lot of people are indeed misunderstanding the "original purpose" of those questions.
You can use those shortcut after explanation or show them the not shortcut version. They want to know your understanding of basic data structures/algos.
Believe or not, a lot of people can do some fancy `filter()` `reduce()` functions to solve the problem with 1 line but don't know how to use a simple for loop to achieve the same thing. When you need to do some specific optimizations with your own for loop, this is the key why those questions are designed. Many terrible/slow apps have some filter(map()) like combination code to deal with some simple problem behind the scene, end up has O(n^2) - O(n^3) without concern.
Unfortunately, 99% of algo questions are over complicated due to the markets, hot trends, salary, population, even H1B, etc. I believe the result of the bar rising is a complex problem behind the industry.
@@doc8527 yyeeess, I use Python for my interviews. its my first language and perfect for interviews but using Pythonic shortcuts are so much cancerrr. I hate going to leet code or hacker rank and seeing people throw 1 line solved and theyre so complex in that one line that no one else unless they know the shortcuts will understand, completely destroying the whole point of teamwork
I'm intrigued, how does this work? Oh wait, does it do 2 assignments at the same time, seperated by a comma? Holy 😨It's cool though.
@@dscham1507 Yup. The comma on the right builds a 2-tuple out of the right and left values. The comma on the left pattern matches against sequences of length two and assigns the values it finds to the left and right attributes. It works because the entire expression to the right of the equal sign is evaluated before any of the assignments on the left occur.
🎵"You suck at coding yeah you totally suck" 🎵
"nice tree class, i always wanna make sure that i'm inverting the whole forest " this got me
I have an interview next week and will definitely be using this strategy! Thanks Ben!
This series is amazing, I love your subtle humor.
That's how they made TENET just a bunch of transform classes
Your explanation of swapping left and right was actually very welcome. I made the mistake of not using a temporary variable when I wrote my first swap function and I could not figure out why it wasn't working!!!
8:55 You can do the variable swap in python without that tmp var. You just need to do: node.left, node.right = node.right, node.left
You must be joking right ? Of course, he knows.
but thats inferior to transform rotateY
"they've never touched an underscore in their life" lmaoo, this speaks to me
More of these videos from this Playlist please! Love them!
Google Headquarters: " Don't give Ben a job , UA-cam will miss so many great videos "
❤️❤️🔥
They already have, he's on their payroll thanks youtube. Ben is meta af lol
As an Angular developer, I love you! Most amusing channel on UA-cam all-together!
8:05 best explanation of screwing up swapping. Btw can we use (Node.left, Node.right) = (Node.right, Node.left)?
Edit: It works, you don't even need to use the parentheses.
I haven’t watched this channel in a couple years. Ben, you’re freakin hilarious now ahaha
I’ve never being that happy for subscribing till today. 😂😂😂 I love the personality.
You are getting really good at it, Man. Thanks for the video.
This is the motivation I needed before applying and it's !important to watch twice before an interview.
Watch it recursively with no base case, for sure
"Binopus". For a moment, I heard something else.
bino pusses
🙀
Ben, you have always been on my feed when I start watching more tech videos but I am legit subbing you after this. This is a masterpiece .. 😂😂 .. enjoyed the diss at microsoft and certain someone working there.. 🤣
I'm doubting my entire codebase which was inspired by ben's full-stack tutorials now.
For a second there I thought you're gonna use comic sans and my heart skipped a beat.
Don't you hate when they reject you just because you can't invert a binary tree?
inverting a binary tree it's super easy, barely an inconvenience.
Data structure is fun
It's a pointless demonstration of memory, like taking a test for school.
@@seanlawton7681 do you think it is an algorithm that you need to memorize? LOL!!!
@@Enroxxx We get it bro, you're very smart
"The programming language I'd like to start with is CSS" ~Ben Awad, 2021.
Last time I was this early I wrote 50 lines of code without a single error
I was never this early
It’s so well made that even with no coding knowledge I can tell this is cursed as fuck
The css one got me...
I laughed so hard!
Bro this is killing me... So funny my lord a funny nerd. Subscribed, my man.
I don't know if you all knew that but in python you can literally write-
a, b = b, a
this will switch those two and it's really nice and not very known
7:53 tech with tim got roasteeeeed
4:03 nice one!
Now I can finally apply for a job at Google.
I just started to code. Thanks for showing me how to get a job at Google. I think I'm going to pass it.
Ben is literally my favorite tech channel on UA-cam
This is the first video I watched in your channel. I pinched myself to check if I was dreaming.
You can also go for node.left, node.right = node.right, node.left and that works well too
the 5 spaces made me spill my drink
Im not a python developer, but can't we swap variables in Python just like we can do with JS using array matching (destructuring) ? [a,b] = [b,a]
Loved your coding style, loved your sense of humour.
Counting out the spaces really got me
I was going to sub regardless, but the !important completely sold me. Nice work!
I'm currently trying to self learn, HTML and CSS were a breeze, JS on the other had is a little more tricky. Anyone have some tips or suggestions to help me out with JS retention/ learning?
dude i was waiting for something like this :D, after that interview
I'll be mad if he gets a call after this masterpiece!
Thanks so much Ben
this is the first of your vids that i'm watching. took me a while to figure out, that you're just trolling xD
Solving a problem like this is really helpful. Expecting more..
At 8:40
node.left, node.right = node.right, node.left
works too right?
Ben, you are hilarious and instructive. Thanks for this 🙏
the content just gets better and better
Thanks for the tutorial, especially for the google docs dark mode extension
Will the fix at 9:45 throw an error running under Deno?
This made my whole morning XD
I wanna learn how to code a website but I don’t know where to start. Could you give me some advice?
Great stuff. And a nod (maybe) to the "You Suck At Photoshop" series.
One of the hilarious videos I have watched in a while.
First I thought it was an actual guide on inverting a binary tree... Got hired using this approach, thanks!
My CSS binary tree returned a 500 error, is that good?
Your content is amazing I had to subscribe.
Most of them are C++ chads and have never touched an underscore in their lives xDD I'm dying!
Ben, what do you think of prisma 2 vs typeORM? greetings from Chile.
The "ad" actually popped up at the end of the video!
I never thought that Comfortaa is actually a good font.
Damn I don't normally like youtube videos but this is just too good lol
This is way too comic😂. The few videos I still watch at 1x
Important facts, made even better with the cedar waxwing cameo at the end. Those birds get drunk on berries, that's probably why they want to get inverted.
What's practical usecases of inverting like filesystem or indexing
Alt+F4 to open dev tools is now my favourite shortcut
0:40 I lost it here 🤣🤣 Jeez I'm amazed you made it though with a straight face.
Edit: Okay I love your humour 🤣🤣🤣🤣🤣 This one was incredible!
I came here for a serious video and I was not disappointed. loved it!
I really enjoyed your videos, the jokes are really put me in good mode. Thanks Ben 🖐
This should be in youtube rewind 2021 or get an Oscar or even a Turing award
Love it, recommended to my A Level CS students. Left arms frequently get chopped off. I'm concerned that some won't get the humour, but hey, that's life in the big city.
This is so funny! Brilliant Job!
This video has better CS comedy than the entirety of silicon valley
this video taught me that i know nothing about coding, i need to re-learn everything that sucks ._.
This is really, REALLY good.
Love how the image is commented!