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
"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
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!
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.
**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?
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++
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 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!!!
@@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.)
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.
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.
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.
Haskell ftw data Tree a = Nil | Node a (Tree a) (Tree a) invertTree Nil = Nil invertTree (Node a left right) = Node a (invertTree right) (invertTree left)
What a cliffhanger ending. Birds worried about their nests falling out of inverted trees were waiting to go Hitchcock on that window. Be safe inverting trees around birds giving warning signals, please.
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.
Can you give a real world example where inverting a binary tree is required. What would the application be, and why would it be necessary to invert a binary tree. Binary trees resemble what we used 30+ years ago for rudimentary AI, to try to understand written text, or a complex SQL select statement, but what practical use cases are there for most programmers in business today?
Wondering if the standing out with !important was a joke? Discussion about that seems a little confusing down here and I am not exerienced enough to be sure if good practice or not :D I get usage of !important as a bad practice generally, it says - I do not want to have all states defined in deterministic way, only these are mandatory and override any state overlap by important values. And that generally can get out of hand very quickly. By quick search did not found any good reason for usage elsewhere than styles, so I guess that it was a joke most probably.
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
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?
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
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
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.
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_
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
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 don't know what's more impressive -- your coding skills, or your ability to keep a straight face while giving "advice" :D
"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
"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 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.
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.
**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?
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
"18 font so we can actually see what we're doing"
Someone get this man a medal for this level of comedy
F (for the microsoft interns who bring users to VSCode by making extensions)
btw, they get paid, pretty well.
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
9:54 when you're using Angular in front of Ben Awad
this cracked me up " whenever u look at binary tree it already looks inverted"🤣🤣🤣
6:55 should be 10 spaces
Failed the interview like a chad
That's how they made TENET just a bunch of transform classes
Glad to see the Angular jokes are back 😃😂
*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?
"nice tree class, i always wanna make sure that i'm inverting the whole forest " this got me
"they've never touched an underscore in their life" lmaoo, this speaks to me
🎵"You suck at coding yeah you totally suck" 🎵
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
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
"Binopus". For a moment, I heard something else.
bino pusses
🙀
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
"The programming language I'd like to start with is CSS" ~Ben Awad, 2021.
At 8:40
node.left, node.right = node.right, node.left
works too right?
I just started to code. Thanks for showing me how to get a job at Google. I think I'm going to pass it.
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
It’s so well made that even with no coding knowledge I can tell this is cursed as fuck
I'm doubting my entire codebase which was inspired by ben's full-stack tutorials now.
Most of them are C++ chads and have never touched an underscore in their lives xDD I'm dying!
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
For a second there I thought you're gonna use comic sans and my heart skipped a beat.
Last time I was this early I wrote 50 lines of code without a single error
I was never this early
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!!!
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 have an interview next week and will definitely be using this strategy! Thanks Ben!
At 4:38 the amount of people left are actually the one's who'll be the future of programming , we are just temporary.
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.
Wow. Best youtube programming tut. A+. 5/5 stars. 10/10 thumbs up. 0/0 angulars. 100% rotten tomatoes.
You can also go for node.left, node.right = node.right, node.left and that works well too
Counting out the spaces really got me
I never thought that Comfortaa is actually a good font.
Alt+F4 to open dev tools is now my favourite shortcut
This series is amazing, I love your subtle humor.
I applied to MS in 2017, they're still reviewing my application apparently. Same with a lot of other companies.
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.
this video taught me that i know nothing about coding, i need to re-learn everything that sucks ._.
- "I'm getting compiler errors. Let's make this into a comment"
* proceeds to change the background text color to green *
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.
This is the first video I watched in your channel. I pinched myself to check if I was dreaming.
Idk if you will see this, but a one liner to switch variable values is to do:
var1, var2 = var2, var1
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
Haskell ftw
data Tree a = Nil | Node a (Tree a) (Tree a)
invertTree Nil = Nil
invertTree (Node a left right) =
Node a (invertTree right) (invertTree left)
Will the fix at 9:45 throw an error running under Deno?
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]
“Oh wait I’m getting compile errors”
I’ve watched this video so many times in less than 24 hours I’m losing it
the 5 spaces made me spill my drink
I just came here to rewatch this masterpiece of comedy!
The css one got me...
I laughed so hard!
When I first watched it, I thought this was very hard but after a year. I can finally invert a binary tree.
all the puns inside this video can be use as "You Lough, You Loose" challenge LOLLL
4:03 nice one!
Now I can finally apply for a job at Google.
I’ve never being that happy for subscribing till today. 😂😂😂 I love the personality.
As an Angular developer, I love you! Most amusing channel on UA-cam all-together!
Bro this is killing me... So funny my lord a funny nerd. Subscribed, my man.
This video has better CS comedy than the entirety of silicon valley
The fact that this made a whole lot of fucking sense is making me question absolutely everything
What a cliffhanger ending. Birds worried about their nests falling out of inverted trees were waiting to go Hitchcock on that window. Be safe inverting trees around birds giving warning signals, please.
Writing code in a Google Doc is the ultimate way to display your superiority.
4:48 alt + F4 to open dev tools, great!
curious to see the drop rate of the video at 4:40
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
An inverted bird: you're HIRED.
Its ironic that we had Binary Search Trees today in lectures and i get this recommended...
Loved your coding style, loved your sense of humour.
Birds to Ben: What are you looking at?
Ben: Imma invert these bird's whole tree.
This turned out bad.
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.
Hey i just did that on my phone interview and got hired at Google as an Softwareengineer. Thanks dude!
Can you give a real world example where inverting a binary tree is required. What would the application be, and why would it be necessary to invert a binary tree. Binary trees resemble what we used 30+ years ago for rudimentary AI, to try to understand written text, or a complex SQL select statement, but what practical use cases are there for most programmers in business today?
“It’ll crash like my sister when she’s driving” Ben is ruthless 😂😂
Wondering if the standing out with !important was a joke? Discussion about that seems a little confusing down here and I am not exerienced enough to be sure if good practice or not :D I get usage of !important as a bad practice generally, it says - I do not want to have all states defined in deterministic way, only these are mandatory and override any state overlap by important values. And that generally can get out of hand very quickly. By quick search did not found any good reason for usage elsewhere than styles, so I guess that it was a joke most probably.
My CSS binary tree returned a 500 error, is that good?
Bruh I do suck I feel like nano-ing a text file in the terminal is next level
lets invert the whole forest together ben
“This is how you disgrace yourself this is how you disgrace your family...”
This video made me realise that the better you are at programming the quicker you realise the theme of this video.
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
When you hit that 5th space I passed out.
More of these videos from this Playlist please! Love them!
If you choose javascript, you can do [node.left, node.right] = [node.right, node.left]
Thats also doable with Python
@@exactzero awesome, both great languages to work with