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
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
**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: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.
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++
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!!!
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.
@@bellarose6310 Yes, speaking seriously, this is a completely unserious video. (The python stuff at the end probably works, but if you're actually trying to learn, you're better off elsewhere.)
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
For a second, you actually had me wondering if I had mandela effected into a universe where alt-F4 opens dev tools and doesn't close a window. I double checked. So far, still the same universe.
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.
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.. 🤣
To avoid r/whooshing anybody, ill explain it here. Im javascript ! means "not". Therefore javascript was making a joke that css is not important. But in css, if you want to override all variables with a value, you have to use the exclamation mark (!). Therefore, css thinks javascript said that she is important. r/whoosh
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.
Not gonna lie I was actually impressed when you inverted the whole google doc
hahah emas
u ll become a fine interviewer
🙃
Rotated
Because you've never used transform before or because you don't know how to open dev tools?
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
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 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.
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
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*
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.
"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
"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
**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
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!
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.
6:55 should be 10 spaces
Failed the interview like a chad
F (for the microsoft interns who bring users to VSCode by making extensions)
btw, they get paid, pretty well.
*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?
this cracked me up " whenever u look at binary tree it already looks inverted"🤣🤣🤣
1. The DOM is not binary
2. rotation is probably wrong scaleX(-1) is more accurate
3. * is not correct
NO HIRE!
...but a like and subscribe
9:54 when you're using Angular in front of Ben Awad
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
Glad to see the Angular jokes are back 😃😂
"nice tree class, i always wanna make sure that i'm inverting the whole forest " this got me
That's how they made TENET just a bunch of transform classes
🎵"You suck at coding yeah you totally suck" 🎵
"they've never touched an underscore in their life" lmaoo, this speaks to me
This series is amazing, I love your subtle humor.
I have an interview next week and will definitely be using this strategy! Thanks Ben!
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
Google Headquarters: " Don't give Ben a job , RUclips will miss so many great videos "
❤️❤️🔥
They already have, he's on their payroll thanks youtube. Ben is meta af lol
"Binopus". For a moment, I heard something else.
bino pusses
🙀
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
It’s so well made that even with no coding knowledge I can tell this is cursed as fuck
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!!!
I'm doubting my entire codebase which was inspired by ben's full-stack tutorials now.
I just started to code. Thanks for showing me how to get a job at Google. I think I'm going to pass it.
As an Angular developer, I love you! Most amusing channel on RUclips all-together!
"The programming language I'd like to start with is CSS" ~Ben Awad, 2021.
For a second there I thought you're gonna use comic sans and my heart skipped a beat.
Most of them are C++ chads and have never touched an underscore in their lives xDD I'm dying!
Last time I was this early I wrote 50 lines of code without a single error
I was never this early
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.
Wow. Best youtube programming tut. A+. 5/5 stars. 10/10 thumbs up. 0/0 angulars. 100% rotten tomatoes.
This is the first video I watched in your channel. I pinched myself to check if I was dreaming.
Counting out the spaces really got me
I’ve never being that happy for subscribing till today. 😂😂😂 I love the personality.
Alt+F4 to open dev tools is now my favourite shortcut
I never thought that Comfortaa is actually a good font.
At 4:38 the amount of people left are actually the one's who'll be the future of programming , we are just temporary.
the 5 spaces made me spill my drink
The fact that this made a whole lot of fucking sense is making me question absolutely everything
Loved your coding style, loved your sense of humour.
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
More of these videos from this Playlist please! Love them!
9:00
You can do node.left,node.right = node.right,node.left.
I know that this a joke, but just in case someone is genuinely interested
POV: you're taking ben seriously and you agree to whatever he says
So (serious question), I am supposed to ignore this video right? Not use this to learn? Because I really cant tell
@@bellarose6310 no it’s a serious video just filled with a few jokes. CSS is probably the easiest way to invert a binary tree
@@bellarose6310 Yes, speaking seriously, this is a completely unserious video. (The python stuff at the end probably works, but if you're actually trying to learn, you're better off elsewhere.)
@@bellarose6310 if you are here to learn data structure and algorithms then you're in wrong place. His react tutorials are good tho
I just came here to rewatch this masterpiece of comedy!
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
your voice is so serious I almost fell for the alt f4 trick
“Oh wait I’m getting compile errors”
I’ve watched this video so many times in less than 24 hours I’m losing it
This video has better CS comedy than the entirety of silicon valley
For a second, you actually had me wondering if I had mandela effected into a universe where alt-F4 opens dev tools and doesn't close a window.
I double checked.
So far, still the same universe.
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.
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.. 🤣
When I first watched it, I thought this was very hard but after a year. I can finally invert a binary tree.
Ben is literally my favorite tech channel on RUclips
You can also go for node.left, node.right = node.right, node.left and that works well too
4:03 nice one!
Now I can finally apply for a job at Google.
Writing code in a Google Doc is the ultimate way to display your superiority.
You are getting really good at it, Man. Thanks for the video.
Its ironic that we had Binary Search Trees today in lectures and i get this recommended...
The "ad" actually popped up at the end of the video!
Ben: *rotates the whole Google doc*
FAANG: Fuck! Hire him right now!
I haven’t watched this channel in a couple years. Ben, you’re freakin hilarious now ahaha
An inverted bird: you're HIRED.
I was going to sub regardless, but the !important completely sold me. Nice work!
JavaScript to CSS - you are !important
CSS - *blushes*
JavaScript - *grins*
To avoid r/whooshing anybody, ill explain it here.
Im javascript ! means "not". Therefore javascript was making a joke that css is not important. But in css, if you want to override all variables with a value, you have to use the exclamation mark (!). Therefore, css thinks javascript said that she is important.
r/whoosh
"You're gonna want to tell them to hit alt-f4 to open up dev tools-" Savagery.
This should be in youtube rewind 2021 or get an Oscar or even a Turing award
When you hit that 5th space I passed out.
- "I'm getting compiler errors. Let's make this into a comment"
* proceeds to change the background text color to green *
First I thought it was an actual guide on inverting a binary tree... Got hired using this approach, thanks!
this video taught me that i know nothing about coding, i need to re-learn everything that sucks ._.
"i always wanna make sure im inverting the whole forest" HELP
this is the first of your vids that i'm watching. took me a while to figure out, that you're just trolling xD
I applied to MS in 2017, they're still reviewing my application apparently. Same with a lot of other companies.
Birds to Ben: What are you looking at?
Ben: Imma invert these bird's whole tree.
This turned out bad.
The css one got me...
I laughed so hard!
“I want to make sure I’m inverting the whole forest” 😂😂
Who actually learnt how to invert a binary tree?
Me! I do recursion at work but shit my pants when asked to invert a binary tree.
CSS is a good way to do this
This is giving me "you suck at producing vibes" minus the phalluses
“It’ll crash like my sister when she’s driving” Ben is ruthless 😂😂
This video made me realise that the better you are at programming the quicker you realise the theme of this video.
i've been doing this all wrong
This video caused actual, physical pain because I was laughing the entire time.
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'll be mad if he gets a call after this masterpiece!