Try our new data structures website: keeponcoding.io
@druvak4 жыл бұрын
I've been a software engineer for 24 years. I've never ever needed to write a binary search function.
@JM-gz1ej4 жыл бұрын
exactly
@slayerzerg4 жыл бұрын
yea but it's straight forward should be simple for ya
@troshenkov4 жыл бұрын
Companies do not have the time and qualifications to test the professional knowledge of hired employees. To get into Google or Facebook, you need to learn how to pass interviews. In fact, any Indian seller of Seven-Eleven knows how to pass an interview with these IT companies in Silicon Valley. My roommate with 10 years in journalism learned algorithms and trained to pronounce their solutions in English, he got a job in Apple. People who are 15, 20, 30 years in the profession, this leads to dissonance.
@SuddenHamster4 жыл бұрын
@@troshenkov This is complete bullshit. If Google or Facebook would hire every Seven-Eleven guy those companies would never be the richest companies in the world, they would be a Seven Eleven. The only reason why they are the richest companies in the world because they hire the smartest people possible. In the field of computer science and software engineering there is no better way to determine how good you are then asking to solve an algorithmic problem. You roommate is probably a very smart guy or he has been hired on non-engineering position (which are plenty in companies like Apple etc.)
@troshenkov4 жыл бұрын
@@SuddenHamster Do you know why there are so many interview courses? This is a huge business.
@TheAbhorrent14 жыл бұрын
This is ridiculous I've been a binary search tree for 30 years and never once have I had a software engineer traverse me.
@BillClinton2284 жыл бұрын
@Lucas I'm convinced these algorithm interviews are about the Lead flexing on strangers.
@beastmasterbg4 жыл бұрын
that would be sexual harrasment :D
@TheGhost0944 жыл бұрын
@@BillClinton228 yeah exactly. It's just an elaborate dick measuring contest.
@chickenkm3 жыл бұрын
how can you be a tree?
@bugdiver3 жыл бұрын
@@chickenkm because, He is GROOT
@pranjaldoorwar97433 жыл бұрын
Interview: Search a binary tree. Job: Please make CTA blue, client said her favorite color is blue.
@nichtbonus5263 жыл бұрын
5
@cloudy-head3 жыл бұрын
@@nichtbonus526 nahh 6
@FF18Cloud3 жыл бұрын
Well, this is Bloomberg, so, the clients would here would be their UX department trying to tell you why you have to move a div like, 15 px left for a better investor "experience" *Disclaimer* I don't work at Bloomberg, just a company in the same industry as of this time
@pranjaldoorwar97433 жыл бұрын
@@FF18Cloud haha 😂
@microapple973 жыл бұрын
😂😂😂
@jedlechner37882 жыл бұрын
1. Read the question twice. Look at the examples. 2. Clarify the details of the definitions. In this case what is a "successor" 3. Clarify the constraints. 4. Determine edge cases 5. Choose an algorithm associated with the question. e.g. trees -> inorder, pre-order, post-order, bfs, dfs. 6. Implement the naive solution and discuss time and space. Write clean code. 7. If time talk about how you will improve the solution and implement if you can.
@ShadOBahn2 жыл бұрын
now do all that while mock managers are breathing down your neck asking you if the production fix is ready yet, devops is ready to deploy and SLA's are breached.
@LOLLOL-ff9sq2 жыл бұрын
Ty
@khatdubell Жыл бұрын
This advice doesn't always work. Interviewed with amazon once, asked the interviewer several pointed questions before i got started to make sure i 100% understood what he wanted. This was a 45 minute interview. With like 15 minutes left he asks me a question like "how are you going to handle x" I was like "i asked you about that at the start and you said Y, so i built my solution around that" I had all of 15 minutes to try and throw out everything i'd been thinking of for the last 30 minutes. recontextualize and resolve the problem and write it all down (this was a white board) _then_ he still wanted to ask me questions about my now fictional program. long story short, the interviewer boned me, big time. I aced _all_ the other interviews (amazon holds multiple interviews at once on a single day over the course of several hours), so it _had_ to have been this one guy.
@SmoothCoaxing Жыл бұрын
@@khatdubell so what happened after bro you cant write a whole documentary then not finish it
@khatdubell Жыл бұрын
@@SmoothCoaxing Nothing happened after. I didn't get the position. while i didn't enquire and further as to why they made their decision, i believe it was that one guy.
@patrioticgrind2 жыл бұрын
This interviewer giving a lot of guidance. I’d be grateful to have him. Other interviews don’t really do that
@DavidGreen342 жыл бұрын
The interviewer was being super nice with hints. Most would just give you basic instructions, allow you to ask clarifying questions, and then go silent as you struggle through it.
@komerczka2 жыл бұрын
Thats the point of this interview, not really coding the binary tree, but have something to work on together and see how the guy behaves under pressure.
@mr_cod3 Жыл бұрын
He's from My country and i feel so proud hearing that
@elliotcounasse Жыл бұрын
i just stumbled on this, and i’m confused how this is a interview, seems more like a lesson from a professor, however i’m very new to any of this so
@darthtrader7605 Жыл бұрын
@@elliotcounasse Apparently it is a peer to peer interview. Odd thing to call it, "interview". Seems more like an exercise in fundamental coding.
@Gotejjeken4 жыл бұрын
As a software engineer, I swear the only time questions like these matter are in college. Maybe interview for top 5 percent of jobs, but the other 95 percent definitely not going this in depth. Companies need bodies not rainman.
@zenedge75994 жыл бұрын
exactly, some my most fun jobs had no whiteboard interviews, just us devs talking shop, those are the real guys, this coding whiteboard shit has its place... in the classroom
@KraziAzian4 жыл бұрын
"Bodies not rainman" that is such a good line
@RodS_444 жыл бұрын
I already had technical interview like that and it never productive. It's impossible to keep calm. In a real work scenario, it's ok to research and you don't need to know everything from heart. The important is to know how to think to find the best solution but not resolve things like this and feeling embarrassed.
@ryankramer22174 жыл бұрын
I practiced these hard in college (because I had to for the classes). Never used it in a real interview.... ever!! Don't waste your time. Learn a framework like Spring, React, React Native, etc. and you are good.
@R1ka4 жыл бұрын
@Gotejjeken me too , the only time that i require someone to do this is the one i teached him it ( as an assistant professor) .
@geecee19903 жыл бұрын
I've been a software engineer for 25 years. I have interviewed TONS of prospects. I've NEVER had them code without using a compiler. Typically, I would just come up with a project, give them the directions and let them sit in front of a computer for one hour and hammer it out the way they normally would. They get the compiler, internet, whatever they need. Now, given that, I do expect o see much better code than what would be written in notepad :) As long as they can then thoroughly explain their project to me I'm good with it.
@WyMustIGo3 жыл бұрын
You must be inexperienced. There is a difference between being a progammer and a principal engineer, and also probably 100k a year more. Clearly you never made over six figures.
@geecee19903 жыл бұрын
@@WyMustIGo Oh give me a fucking break.
@geecee19903 жыл бұрын
@@WyMustIGo I have a senior position in a global company of 75000 employees and I make more than most CEOs in my town. I've interviewed probably hundreds of people in my 27 years in the business and I know what I'm talking about. And the bottom line is someone like you could never afford to hire a guy like me.
@LeTrollzGamer3 жыл бұрын
@@WyMustIGo you scream narcissist energy
@LeTrollzGamer3 жыл бұрын
@@WyMustIGo I'd rather be simple than an arrogant ass
@Mrdresden3 жыл бұрын
10 years in the industry and I echo what others have said here. There is no particular reason to know how to solve this problem from memory. However being able to work through it is the real test here. If I were ever to sit over someone for a coding interview like this, I wouldn't really be looking for the correct solution, rather the approach and how long the individual stick with it.
@gepliprl85582 жыл бұрын
I mean the majority of dev, programmer interviews is already like that. However, if someone else performs better (i.e. solve the problems much faster and efficient) than our chance to be accepted decreases significantly.
@otallono Жыл бұрын
@@gepliprl8558 if they're only looking to hire one person
@gepliprl8558 Жыл бұрын
@@otallono yes that's one thing, another thing is that retaining devs are hard, things like stress, deadline, team disintegration, high demand, competition, etc. It's a big money industry but has it's own curse.
@nilfux Жыл бұрын
But not in 20 min in front of someone., That's not the same thing. It's bullshit.
@JustinK011 ай бұрын
this is the reasoning behind ALL math classes throughout ALL education, so many students are like "trig/algrebra is dumb, why do i even have to know this? ill never use it" it teaches you how to think logically and solve problems. that the entire point
@dave43473 жыл бұрын
I’ve had a very successful career as an engineer working on some very cool projects. To the prospective and newer developers out there-when I see companies interviewing like this I run. If this is your jam then cool, but it’s never been my thing. Please don’t buy into the notion that coding challenges are required in the interview process to have a successful career as a developer.
@Ybby9992 жыл бұрын
Thank you! It's been a while since my datastructures & algorithms class and I really dislike the idea of coding challenges.
@antwanwimberly17292 жыл бұрын
@@Ybby999 same - it sucks!
@indra_vrtrahan2 жыл бұрын
@@Ybby999 Be real man, who has EVER liked them, unless you had like whole time in the world, and it was simply among friends in college, that is different, actuall challenges are pretty cancer, that is blunt honestly.
@Another0neTime2 жыл бұрын
I think it has some merit. My company hired an SDET that didn't know OOP principles. They tried not doing a coding interview. 4 years later, they still don't know OOP and still stuck in the same position. They have even had mentoring.
@the1anonymouse2 жыл бұрын
@@Another0neTime Coding challenges and coding interviews don't go over OOP principles
@ikeo86663 жыл бұрын
this is one of those interviews where you can get the interviewer to give you the answers because it makes them feel smart. so easy
@JM-gz1ej4 жыл бұрын
Majority of software engineers never work on these nonsense in day to day work
@justinskidmore96774 жыл бұрын
hear hear
@athegreat884 жыл бұрын
I've always wondered if the real job is similar to these online interview or practice problems. Have you worked as SE before? What types of work do you do on your day to day job? Really Curious to know...
@humann56824 жыл бұрын
@@athegreat88 The problems and type of interviews on YT are not too far away from what you get asked. The problem is, as the OP says, you are asked to answer problems that are in no way reflective of the actual work you do. Once I pass the technical interview, I always ask the company "Can you tell me on what projects does the company use the algorithms or solutions asked for in the technical interview"? No single question you can ask in a tech interview will make the interviewers squirm as much lol. They know they have just asked you to demonstrate knowledge that is unrelated to the role.
@athegreat884 жыл бұрын
Hu Mann 3 more years and i guess i’ll see what cs majors actually work on. If u guys don’t use arrays or data structures in an actual job then i wonder what the “Actual” job or work really is. Really curious to know. What part or section of what we learn in our CS course do we mostly use for jobs?
@michealnd9694 жыл бұрын
If only demostrate how you think to solve Problems. Its not all about building things, but analyzing and solving problems. Critical thinking, logic, algorithm. Syntaxes changes but logic is always the same.
@AdityaSingh-cv9nl3 жыл бұрын
Who is here after Hated Tarun description It's me
@ly_lols3 жыл бұрын
Yeah me
@maybeimdulu3 жыл бұрын
Me me!!!
@ishir14953 жыл бұрын
me
@darshkatiyar7d743 жыл бұрын
Me
@kiNGkiNG-bu6dm3 жыл бұрын
H bhi
@jacquesduplessis89443 жыл бұрын
So I need a cheaufeur to drive me around: skills required are, mechanical engineering to build the limo each time I need a lift to the office.
@football125693 жыл бұрын
Underrated comment
@shockbilegaming88653 жыл бұрын
this is sooo underrated oh my god !!!
@djk803 жыл бұрын
I mean if the chauffeur was making hundreds of thousands of dollars per year. It would be nice if they could fix the car as soon as it breaks or continue to upgrade the car throughout the years rather than be having to buy a new one...... That would be worth it. Especially if he's driving me around to extremely important meetings where it would cost my company potentially millions of dollars if I was late or didn't make it
@kungfublob59513 жыл бұрын
@@djk80 "fix the car", Right, let me just get my wrench and pull out the engine then disassemble it, shouldn't be too long. It will be ready in 48 hours.
@TwinTurboOnly3 жыл бұрын
@@kungfublob5951 Do you know what a mechanic is bro? Or a lift? or tools even?!
@akzarma3 жыл бұрын
**Code runs successfully** Him: cool Interviewer: cool. **leaves the meeting**
@tan-os2ed3 жыл бұрын
Run your code and hit the road 🚴🚴
@kushal60653 жыл бұрын
cool
@andrewalarcon86403 жыл бұрын
cool
@Akira-sh7ts2 жыл бұрын
cool
@konno_donnoi78512 жыл бұрын
cool
@itsukiuehara62923 жыл бұрын
maybe he is hiring for a "binary tree interviewer position" that is why they are discussing binary trees.
@keshavnathoo12184 жыл бұрын
From all coding interview videos i've seen, the companies really i mean REALLY like binary trees questions
@artymar15374 жыл бұрын
I know, majority of the questions are either sorting or search.
@nomadsome3 жыл бұрын
Engineers in this video: let's do some real algorithm work to get hired Founders of 95% products: I need to integrate Stripe with WordPress
@chriskerley15083 жыл бұрын
Binary trees do come up sometimes in development.
@grantmoore87903 жыл бұрын
@@chriskerley1508 no, they don't.
@chriskerley15083 жыл бұрын
@@grantmoore8790 Okay. Yeah your right. I revised my answer.
@challengecoins4u3 жыл бұрын
LOL so true...
@eyesopen61103 жыл бұрын
@@chriskerley1508 Lol, No. they don't..
@JimzZel2 жыл бұрын
My biggest advice for interviews like this "communication is key".. speak with the guy who is interviewing you say what you think. It gives the guy an idea on how you think. Most of the time it is not about the technical knowledge itself but how you handle it.
@JimzZel2 жыл бұрын
@@shalimkhan1986 can happen.. Then you fire them.
@JimzZel2 жыл бұрын
@@shalimkhan1986 my personal opinion about this, most of the time you don't want to work for them.. 😅
@user269122 жыл бұрын
Or woman
@JimzZel2 жыл бұрын
@Hooch Smeeth you will not be the one sitting on the other side of the table. Never been fired.
@Tiredgeek Жыл бұрын
Be easier if the guy spoke plain English.
@dingdong33353 жыл бұрын
I'm good at data structure when I'm in college but now I've already forgotten most of them. Never use any of them since I started working and maybe never ever will.
@erazlle3 жыл бұрын
I'm not a coder and have obsoletely no idea what's happening but I'm enjoying these magic words.
@smomingi3 жыл бұрын
lmao same I have literally no idea what's happening
@michaelnaylor82454 жыл бұрын
It seems like they’re interviewing each other. I think it was more of a collaborative problem solving exercise
@aminsehla38146 ай бұрын
and that's great way to find solution in corporation, so why not
@zHqqrdz4 жыл бұрын
10 years of development, code is a passion for me. I had to use a binary search once in my whole career, went to Google and copied the algorithm. Your role as a programmer should not be to be able to recreate already found algorithms. Rather it should be to know when why and how to use them. Maybe show a real-world example, and ask the interviewee how he'd design it from a macro perspective, then help him jump some steps, show a very slow implementation and ask him how this could be optimized (using which algorithm for example), what are the caveats, etc. Now you have someone solving a problem, maybe interested in solving this problem, and he doesn't have to be a talking Wikipedia page working on a problem which he'll never encounter in his day-to-day job.
@samiriraqui7504 жыл бұрын
I've had it once i got into an internship, to parse a tree (N-ary tree) lol, guess i'm not that lucky. the worst thing to start a career with
@MrObsvenchilde3 жыл бұрын
I memorized it. The EPI book said that 90% of programmers couldn't code it from memory. So I memorized it.
@montgomeryfrenwheringwerth55843 жыл бұрын
They aren't testing your ability to write an algorithm. They are testing your ability to break a coding problem down into steps and solving it.
@ttt694203 жыл бұрын
@@montgomeryfrenwheringwerth5584 Uh, that's what an algorithm is.
@montgomeryfrenwheringwerth55843 жыл бұрын
@@ttt69420 Yes, but the algorithm is not what matters. You don't necessarily have to get the algorithm working in the interview. They want to see if you are approaching it correctly. If you memorized how to write the algorithm you were asked to write, it would be quite obvious to the interviewer and it would not impress them.
@tuananh2842204 жыл бұрын
Nice zoom meeting of 2 guys trying to complete final project before Thanksgivings!
@JRoblesCares3 жыл бұрын
hahahahahaha!!
@DTSupstateNY2 жыл бұрын
I’m in the Bay Area cali response “ohh ok” lol classic small chat with a guy who stays in front of the computer all day
@IsaacC20 Жыл бұрын
Traverse the tree in-order. When visiting a node, check if it's the inputNode. If so, set a "nodeFound" flag and continue traversing. Having found the inputNode, at the beginning of the next recursive call, check if nodeFound flag is set (which it should be) and if so, set nodeFound to false and return the current node (which would be inputNode's successor).
@joesoultanis3724 Жыл бұрын
This is a good solution but it is O(n) where n is the number of nodes, and it ignores that the structure given is a BST tree, which if balanced, lets us find the target node in O(logn).
@danh33634 жыл бұрын
95% of devs will never need this. The real question is how well can the devs take requirements and create an effective solution.
@googavo1d3 жыл бұрын
you mean like how well a dev can use 3rd party libs?
@cybienoa35303 жыл бұрын
They won't need it, but it's so easy that anyone but a junior should write it up in a few minutes after spending a few minutes to understand the question
@publicalias81722 жыл бұрын
@@cybienoa3530 Which google search class did you graduate from if I may ask?
@ooooiii80442 жыл бұрын
@@googavo1d Abstractions exist everywhere, with that logic we may say that you have code linux from scratch before you're a true dev
@tensor51132 жыл бұрын
@@googavo1d The biggest idiot in the world, is one who recreates everything from scratch
@ImEmix4 жыл бұрын
pretty much giving you the answer the whole way through the interview.
@revanthsai78944 жыл бұрын
Two cases here Case 1 - When right subtree of the node is not null. In this case the successor is the minimum value in the right subtree. Case 2. When the right subtree is null. Traverse from the root to the node. First time we go left in this traversal is the predecessor node.
@joseocampo75614 жыл бұрын
That was what I thought too!
@ImTheBoss9144 жыл бұрын
In the case of finding, Node14 in order’s successor, your case 2 would return 9 ?
@gianlucamb9 Жыл бұрын
As a self-taught and still in the early stages of becoming a decent Software Engineer, I am realizing that these problems are actually very logic-based. If you can understand the problem and break it down into simpler problems, you already have 60% of it solved. Figuring out the logic to solve each part is another 30%. The coding part is just 10% and it is the easy part since you are just translating the answer that you already have into code. Please let me know if I'm wrong about this.
@le_deer Жыл бұрын
There are questions where the "understand part" is rather easy, but the implementation with all corners cases is tough. Search for "Median of two sorted arrays" or "Text Justification"
@nandohosp312 Жыл бұрын
yes you are wrong
@TanishFX Жыл бұрын
can you explain then@@nandohosp312
@liquidmetal718 Жыл бұрын
Yes , you are wrong. It simply means you've solved only easy problems or adhoc ones.
@TimothyBrake3 жыл бұрын
It’s an academic question and tests the problem solving skills but in professional development this is highly unlikely you will need to implement a binary search and find the next in order. If someone is writing it in your team, slap him and tell the developer there are libraries for that and most likely there is something wrong with the use case the developer is implementing from a business perspective. If the business is writing a framework better than existing frameworks then... good luck 😀
@szkoclaw2 жыл бұрын
This is an intelligence test, not a knowledge test. Intelligence tests are otherwise illegal in recruitment.
@RadojeFrom4 жыл бұрын
What I learned from this video "Oh yeah, yeah, cool. Okay, yeah, yeah cool. Okay"
@rylordrylord73474 жыл бұрын
Lol
@skacademy..dailyquiz27044 жыл бұрын
😂😂😂😂🤣🤣🤣me tooo
@soruzein29884 жыл бұрын
"Exactly"
@googavo1d3 жыл бұрын
the binary language!
@gulshanbakle11573 жыл бұрын
I learned about 10 new ads!
@Asiagosik4 жыл бұрын
During Bloomberg technical rounds, the person being interviewed isn't usually asked to compile the code
@nathansire66233 жыл бұрын
Bloomberg did mine in a Google Doc. I aced it. Then he said I did not know what I was doing.
@迈克华莱士-p2u3 жыл бұрын
@ThePrivateJoker Because talking is cheap, show me the code.
@迈克华莱士-p2u3 жыл бұрын
@ThePrivateJoker It's a trade off. No one can develop an application in 30 minutes or so.
@迈克华莱士-p2u3 жыл бұрын
@ThePrivateJoker There're separate parts for experience and behaviral questions. But trust me, I'll be able to bullshit and cheat the interviewer like a boy if I want. But cheating on "puzzles" part is way more difficult.
@迈克华莱士-p2u3 жыл бұрын
Where is the great Joker?
@IsmaelPoteau4 жыл бұрын
The problem with these interviews is equating that how fast you come up with the solution to the problem to how well you understand data structures and algorithms.
@MiloDC2 жыл бұрын
Fast and clever is all these college boys appreciate.
@minerbob43343 жыл бұрын
Just perform a search on the node using recursion and then if the right child doesn't exist, go back to each of the parent nodes and find which of the parent nodes has a value greater than the node you're looking for.
@MrBlackspoon2 жыл бұрын
Exactly recursion is key
@publicalias81722 жыл бұрын
@@MrBlackspoon No YOU'RE the key and might I add, Breathtaking!
@jkaryskycoo Жыл бұрын
I don't see how they're even approaching it without initially talking about recursion. These interview videos always seem to miss the correct solutions.
@rishdhoni319 Жыл бұрын
@@publicalias8172 YOU'RE ALL THE KEY AND BREATHTAKING
@Fischyfish Жыл бұрын
this is really helpful, it's cool that you recorded this and posted so i know what i will be facing when i advance my coding skills to look for another job
@nothingiseverperfect5 жыл бұрын
OH WAIT. YOU GUYS ARE INTERVIEWING EACHOTHER
@stealthattack22094 жыл бұрын
LOL
@dreamhere83063 жыл бұрын
No that Indian is interviewing the foreigners
@vladandrei513 жыл бұрын
These kinds of cliche questions are never ever used in real-life situations. You can literally learn by heart those types of things and pass any interview with breeze but have no idea what you're doing otherwise.
@randomperson37303 жыл бұрын
You really can BY-HEART ALL these questions? You can't. You HAVE to come up with solutions on the spot eventually. They even ask you follow up questions if they get the hint that you've memorized this solution. And you can only come up with solutions on the spot if you have good problem solving skills. And you can only have good problem solving skills in such questions after practicing them. Saying that "people can just BY-HEART these questions and pass any interview after a week's preparations" is like saying "people can just BY-HEART all the syntax of javascript and remember all the working of whole MERN stack and pass the interview after a week's practice only". The point being, both approaches work. People get job by doing dsa only, people get jobs without doing dsa at all also. So go for the one which you think is right for you. Another thing I'd like to mention here is that, recruitors prefer dsa questions bcz with these, they can judge you, with numbers. It's tangible how many dsa problems someone solved. But it's not tangible how good of a project someone made. To judge a project, interviewers have to spend a lot of time. And remember that the recruitors that do use dsa questions, don't just use dsa questions. There is usually also a system's design question and computer theory questions. Do not forget the behavioral questions as well
@konradzdanowicz50103 жыл бұрын
Yes and no. While these aren't real-life problems, you still need to be efficient in sorting out the solution to an unknown problem in real life. Hence, writing BST is a waste of time as you can memo it (agree), while this one is a good example of a problem that you have to wrap your head around and come up with a solution quickly enough, or at least be able to jam with the recruiter to show of your coop skills. This is a good indication of how the candidate will tackle any potential problem.
@ITsecurityEng3 жыл бұрын
@@randomperson3730 I am Azure dev and I make flan for my guests. This is slick Italian desert. Think like Monaco.
@randomperson37303 жыл бұрын
@@ITsecurityEng i googled it and it looks nothing like a Monaco
@Casprizzle3 жыл бұрын
I swear these tests were designed by HR who have no idea what dev is actually like.
@tommallama96633 жыл бұрын
Thanks for showing this. I have had a few interviews, including one with Amazon (why they wanted me is beyond me..) and I felt so stupid trying to come up with a solution. Seeing that it's just par for the course really makes me feel relieved (and inspired quite frankly). I really appreciate you and your channel. All the best man.
@joshuamaltez47042 жыл бұрын
Howd it go?
@tommallama96632 жыл бұрын
@@joshuamaltez4704 with Amazon, not well. They are strictly interested in people who live and die by O(n) and nothing else, but I was able to secure my dream job with a game company so in the end, it worked out! Thanks again for the insight!
@bb-xj9ed Жыл бұрын
can you help a brother out, been trying to find a job@@tommallama9663
@imfrommars73628 ай бұрын
@@tommallama9663 yo dude how's everything going now?
@tommallama96638 ай бұрын
@@imfrommars7362 I learned being a software engineer wasn't for me, but I took what I learned and ended up being a Technical Producer instead! So it goes to show that these skills are valuable and you never know where you'll land!
@blacksaibot61583 жыл бұрын
Seen a lot of comments about SWENGs never having to do this in their career. I agree, because as coders we DON'T REINVENT THE WHEEL! This is something you ask interns to see how much they've been paying attention to their classwork in undergrad or maybe graduate school.
@msabyss_39982 жыл бұрын
Yeah but WHY ?
@blacksaibot61582 жыл бұрын
@@msabyss_3998 Why WHAT? What point are you not understanding?
@msabyss_39982 жыл бұрын
@@blacksaibot6158 Why would HR ask to see how much I've been paying attention in school ? even if I was an A student, Why is it so important for you guys that I was paying attention ? Whats Academia have to do with all of this ?
@msabyss_39982 жыл бұрын
@@blacksaibot6158 What value does asking people to solve impossible tasks can add to the work environement ? bcs to me it seems that HR nowadays dont really know How to hire talents and instead they keep hiring A students who clearly lack experience
@fajar27423 жыл бұрын
me : can i go to the bathroom sir ? i think i have diarrhoea . *comeback with the solution from stackoverflow
@yashpandey50703 жыл бұрын
Bro😂😂😂😂
@surgeif3 жыл бұрын
I would hire you immediately.
@xiaoyangliao69793 жыл бұрын
Imagine another interviewer solve the problem without "going to the bathroom". Guess who gets the job.
@grandaddy08073 жыл бұрын
21:30 lol
@ankurrunthala3 жыл бұрын
@@surgeif 😂
@anubhavsingh98484 жыл бұрын
They actually missed one case: If the input node was 20, and there was no 25, it would go to the second case and store the parent node as null and child node as 20 i.e., the input node. Then in the while loop, the code will check for null.right, which will throw an exception. So they need to check if in the second case, the parent node is null, return the child node, i.e., the input node.
@camtugueder3 жыл бұрын
Exactly, it looked like the interviewer was going to catch it but no, they didn't look at the very first edge case.
@dapperpanguin9942 жыл бұрын
Node findSuccessor(Node inputNode) { if (inputNode.right != null) { Node next = inputNode.right; while (next.left != null) { next = next.left; } return next; } if (inputNode.parent != null) { //true if (inputNode.parent.left == inputNode) { //false return inputNode.parent } Node prev = inputNode.parent; while (prev.parent != null) { if (prev.parent.left == prev) { return prev.parent; } prev = prev.parent; } } return null; } This was my solution to it. Are there any problems?
@ruhan232 жыл бұрын
spot on, I thought the same
@benjamindickerson93722 жыл бұрын
So you’d have to make sure the input node has a right child and a parent node, right?
@anuraganand60532 жыл бұрын
Precisely
@rajatmishra66284 жыл бұрын
If i get an interviewer this friendly, I'm going to crack Google.
@xfrostbite83284 жыл бұрын
😹😹
@Jagadish123453 жыл бұрын
😂😂👍🏻
@tylersmith26343 жыл бұрын
Lol finally someone who said it! This is an extremely simple problem for anyone who's taken an algorithms class and the dude held his hand the whole way through it. Shouldn't have taken more than 10 min to be done with the problem.
@FF18Cloud3 жыл бұрын
Ugh, I hate it when during the interviews the interviewer tells you to literally shut up and just do the problem -_- Like, the people interviewing you are people you will be working with on the team, their impressions on you are just as important in whether you want to work with these people basically throwing you off on an island and getting annoyed at you
@RaushanKumar-vg2tn3 жыл бұрын
Rajat Mishra I Need A Software Engineer please Reply Sir
@juangoria35173 жыл бұрын
Unless you're writing really complex solutions and i mean backend, optimization, you dont really need to know this... I think searching for solutions online its a required skill for any programmer
@DanielGuzman313 жыл бұрын
This feels more like tutoring than a programming interview ahaha, I wish all interviews were like that!
@The_Esav2 жыл бұрын
I think it’s an important part of working with someone. It’s a good way to see if someone is coachable because at some point someone will not know everything
@samjohns83812 жыл бұрын
Yep, this is exactly as interviews should be. You learn a lot more helping someone with a problem than seeing what they can remember off the cuff in a stressful situation.
@abhibrotomukherjee82394 жыл бұрын
I hate interviewers who are so hand-on, let the person explain their process to come to an answer. I feel like they tunnel my vision towards the solution. I like interviewers who just provide a hint when I am stuck and quite for a few mins or even ask me if I'd like to get a hint on my path.
@zHqqrdz4 жыл бұрын
As an interviewer, it's quite hard to keep a decent pace without giving too much information and respect the timing that management gives you to conduct the interview at the same time. I'll keep this advice to "ask if the interviewee would like a hint". Thanks.
@tridipbaksi24343 жыл бұрын
Anyone after watching hated tarun hit like..
@StardustsCockaigne11113 жыл бұрын
Haha me!
@omjadhav80463 жыл бұрын
Yes
@slouchysenpai19703 жыл бұрын
Me loo
@pritam98733 жыл бұрын
Yep bro
@laxapathinaik61613 жыл бұрын
Bro i didn't understand anything can anyone please explain
@xinli81944 жыл бұрын
For this question, it’s actually looking for the next node in the middle order traversal. So just need to continue the middle order traversal from the input node for one step. If the node has right tree, get the left most node of it. Then if the node has parent, go to it, and check if the node is the left or right child, if it’s the left one, return the parent, otherwise go to the parent and check recursively.
@leetkhan3 жыл бұрын
We may not have written binary search in our software developer journey but the external libraries we use day to day they use these kind of algorithms. It’ll useful when you’re authoring a library.
@ChrisM541 Жыл бұрын
Do you think libraries have gotten to the point where the requirement to actually...program is being eroded?
@dragonceo59112 жыл бұрын
I was 7-11 employee... took a crash course in ds algo and got into Apple now. All we need in life is ds and algo throw the rest of learning away asap.
@francksgenlecroyant3 жыл бұрын
Everybody is just saying that tech company will only ask you to do some complex CRUD operations and not this one we are seeing, haha. Don't forget that we learn such stuffs for the sake of improving our way of thinking and very soon you will be implementing this in real world projects knowing already and understanding what you are doing and why you are doing it! Thanks! Learn Data Structures and Algorithms, you will never regret doing so! Thanks for this great content and I wish you a very Happy Coding in this very Happy New Year!
@AtriTripathi3 жыл бұрын
Please do and upload more of these kinds of videos. These live interviews really help. Thanks a lot!
@benpurcell5913 жыл бұрын
10 years ago, straight fresh from uni I had recently studied BST's and would answer this quickly. 10 years later, I'm generally a better software engineer, by far, but I would have stumbled through this as I've never needed this knowledge day to day. At least for the first 10 minutes while I got my bearings. These kind of questions are daft, I am guessing they came about because people who started Google/early recruits were academics/students fresh from college/uni and it's what they knew. Now these questions are standard as everyone wants to be like Google...
@mikel8091 Жыл бұрын
This problem has an easier solution than shown. Just traverse the tree to find the input node. Save the root node as your return value. When you choose to go left in the search, save your current node as the return value. If the input node is found and has a right node, go right and then left. Return saved node
@dmadhurima3 жыл бұрын
Here from hated tarun 😁
@BENGALReaction3 жыл бұрын
Logic is right, but the coding will give problem. Good way of showcasing an interview, mostly a discussion of a problem
@nikhilraov1004 жыл бұрын
Nice teamwork and problem solving skills on display by both of them . Kudos to both of you
@pataka813 жыл бұрын
so the answer would be... "so you wanna be a software engineer at google ??" damn clement's ad
@kartikchauhan13273 жыл бұрын
Interviewer is very helpful and wants the candidate to come up with the right solution using his own 🧠. That's good to see.
@geneanthony34213 жыл бұрын
I don't know what it is with software interviews. I'm been programming for quite a number of years and anytime I've seen these posted I never think I'd pass an interview. If I was interviewing someone for a job I'd want to see some of their past projects to see what they've done in the past, I'd have them explain why they did something a certain way if it didn't make sense, etc. You can get a good idea of how someone is by how they answer some questions. I'd probably then give them a small assignment or 2 and have them work it to see how it worked. Even in some of these interviews I hear them asking people to use Word or something to write out a program.
@CobraPlays3 жыл бұрын
From Hated Tarun XDDD
@SuddenHamster4 жыл бұрын
It's a big luck to meet a helpful interviewer like this guy. He was guiding you in the correct direction all the way. In my experience interviewers tend to be way less chatty and the only thing that you can hear from them is the keyboard clicking while they are taking notes on what you doing and saying.
@luistellez124 жыл бұрын
Just so you know, if you are in an interview and they keep pointing to you in the right direction you failed your interview already and they are trying to get rid of you but leaving you the smile. Its ok to help a little and give some hints but fixing your code and letting you know how its done it its a bad interview.
@dw45253 жыл бұрын
They’re probably chatting to coworkers on Slack, not taking notes.
@TonyDiCroce2 жыл бұрын
When I interviewed at Bloomberg I happened to have implemented a binary tree on the flight to New Jersey... so it was fresh in my head and I answered it easily.
@jloiterer2 жыл бұрын
This is great. Sometimes even in these technical interviews the interviewer is looking for someone who THINKS - not someone who knows all the answers. Techinically speaking someone who already saw this same problem could write the code in 5 minutes, get the answer right, and the interviewer still knows nothing about them. They don't hire people that just remember a bunch of crap - the job requires thinking. The job involves being wrong sometimes and responding to being told you are wrong and how you respond when you're right and others are wrong. The tech leads what thinking, respectful, and civil people are on their teams.
@Andy-wv2xj4 жыл бұрын
The idea he said about change the getMostLeft from recursive approach to a iteration approach is nice but why the interviewer talking about a irrelevant problem? the candidate doesnt even gonna add any pointer which point to its most left node to every single node of the tree. And this definately avoid expanding call stack
@ari.h.ant.3 жыл бұрын
yeah the interviewer thought that he is trying to change the structure of the tree.
@sid6353 жыл бұрын
Anyone from Hated tarun channel?
@atharva43803 жыл бұрын
Yos😂😂
@nellcrasto39693 жыл бұрын
Heyloo 😂😂
@omjadhav80463 жыл бұрын
Yeah
@nikhil1823 жыл бұрын
Yeah
@shreyaaaa293 жыл бұрын
Yesss
@salesman43964 жыл бұрын
Seems like Puzzle solving, Riddles etc. Programming requires time, patience and lots of thinking. If you cannot solve it today you think over the night and you come back tomorrow and you solve it. At least that is how I code and its pretty successful way for me.
@chanduvamsi18414 жыл бұрын
That's really a good way. I wish I saw this before 3 years. I'm gonna implement from now on.
@jacquesduplessis89443 жыл бұрын
💯
@easyj6 ай бұрын
This gets on my nerve so much, had to go through all this as a frontend, been doing it for 8 years now and still baffles me when some small company with a simple app use these kind of problems to evalute the applicants knowing damn well they will never encounter issues like this
@douggale59626 ай бұрын
Easy. You repeatedly move up to the parent node's child pointers. If you came from the left, set the current node as the current and start over. IWhen you reach the one where you came from the left, you follow the right node once, then dig down the left nodes as far as you can. You are now at the successor. I have been a software engineer for 36 years and I have implemented almost all of the container data structures from scratch in production. Some people don't do infantile work at 5GHz with 32GB of RAM and 4GB/s storage, with copy paste duplicated incompetence.
@thomasmartin66234 жыл бұрын
Guys these questions aren't because this is what you're going to work on on a daily basis, it's to give the interviewer a sense of your ability to problem solve. Nobody is going to ask you to write an algorithm everyday, but if you can reasonably solve it and talk your way through it it shows that you have at least a foundational understanding of the concepts involved and also that you can adapt to solve a potentially odd/tricky problem during a stressful time (the interview). It lets the person know that if they put you on an assignment you're more than likely going to solve it in a reasonably well thought out way and that you understand the potential upside to space/time optimization when it matters. It also shows your communication skills to some extent too so it's good to have a positive approachable attitude while working through it.
@thomasmartin66234 жыл бұрын
@Benjamin You can absolutely get better and improve. Very few people are just born so smart that they require very little practice. Hard work beats out raw intelligence many times and once you code for long enough you start seeing patterns and learning various ways to think about things. Most people spend time practicing these type of interview problems so they arent totally thrown off when they are asked to use some data structure to solve a problem. If you remain dedicated you will succeed. Never let the fact someone else may know it better dissuade you from trying at all. Keep practicing and asking questions. If you want to get good at cooking, you must cook often and with the mindset that you're looking to improve. Same goes for coding or problem solving.
@ttt694203 жыл бұрын
@Benjamin At some point IQ will determine the highest level of abstracted complexity you can deal with. Luckily hardly anything in CS is all that complex. That's why there's hundreds of millions of people who can do it.
@andarkge4 жыл бұрын
This question is actually pretty easy for anybody who knows the property of a BST, but could definitely be challenging for people who are not familiar with it. In the day to day work, a BST is probably being used much more rarely, however, I think this is a good interview to evaluate how fast a candidate can figure out a solution from something that he is totally unfamiliar with (but unfair comparing to those who are already familiar with BST for sure)
@FF18Cloud3 жыл бұрын
Just, the problem is, people commenting will just complain that yeah, "why is this question here if I don't do that?" I know I did twice The question is also really common, so ¯\_(ツ)_/¯ you feel me once, shame on you, fool me twice, shame on me
@B20C03 жыл бұрын
As a noob, isn't a nested set approach similar to bst but optimized for faster queries?
@bran_rx3 жыл бұрын
I was hoping this kinda video would make me hate my life but naa, I'm ready for that interview... fun to watch, putting this on my programming challenges list
@christianonwe20452 жыл бұрын
This is pretty straight-forward to go through with time-complexity of O(n) and O(n) space complexity
@jelooJusta3 жыл бұрын
So friendly interviewer! My last live coding interview was like: - "Write a jQuery-like library for working with DOM" ... - "Ok, I'm gonna use es6 inheritance here" - "Why? No, you shouldn't. Only es5" - "I'm gonna use Object.create() then" - "No. I was expecting something else" - "Can you give a cue?" - "No."
@siddhantpathak20634 жыл бұрын
I want this guy as my interviewer
@shahzadaslam3843 жыл бұрын
i had 3 interviews like these with big companies one time i had the solution but it was not efficient while in other case i almost blackout and could not complete because the time was over then in a third online test I COMPLETE 100% and i was so happy that this time i will make it and now the next interview stages will be breeze go through their second interview BUT in the third interview i was forced again into a interactive coding challenge with a technical guy and in my 20 years software job i never came across remotely where i have to use these challenges AGAIN if given a bit extra time I WILL DO ANY CHALLENGE i have no idea what these companies want i mean write the code in 30 minutes that will be most efficient code in the universe and then spend the rest of 5 hours of the day chilling out with on job friends
@TheMVJunior2 жыл бұрын
Sometimes, I think they don't hire anybody, and just create new features collecting pieces of code from every coding interview... That's what I heard at Deep web 😂.
@peeyar20003 жыл бұрын
Just do inorder traversal and print the next element after the inputed element. Inorder on a bst will print the sorted array.
@atift54653 жыл бұрын
I thought of a very similar approach.. this implementation he made was unnecessarily complex
@vijayshinde63863 жыл бұрын
same I thought..but was not sure so came in the comments section!
@mhmd_aesthetic2 жыл бұрын
Most of the comments are hating on the question of the interview but as a CS major I actually solved it in 1 minute. I know that as a job i will never need to re implement or create the algorithm. Because there’s built in libraries for that. But I think a developer should know how the code is built and how it works.
@PiroKUSS2 жыл бұрын
That's because it's fresh in student/graduate heads but never the seniors since they never use it again. That's what the comments make me think.
@rehthro2 жыл бұрын
In JS. Have all nodes in an array, sort the array in incremental values by using a reduce method (push or unshift the current value into the new array depending on if it's a bigger or smaller number than the last reduce input, you should probably use a spread for this instead...). Then you have a sorted array of numbers.... (assuming the interview requires you to, otherwise you can just type the array in manually in good order but Im sure it'll piss the interviewer off. (guess this is the real interview)) Then all you have to do is take your input, find the index in your new array and then return the value at the array in the next index (value = value at currentIndex + 1) ( or make it fun and return the whole array starting from the input index.) There. Should take 6mins with a fine keyboard but since you may have to adjust for null, unfound values and other possible issues, maybe take a bit more. How is it useful? Well you could sort a fav list of watched movies by inputing the last movie watched to figure out the next one to watch with a search like this maybe for a Netflix app or I guess Bloomberg has other things in mind. Late to this party, I could watch no more than 3mins... Im not actually a software engineer so maybe this will blow up if you write it but it sounds very interesting to think of. Oh by the way someone said efficiency so in case you have a million numbers... split the dictionary
@rahulbhandari35583 жыл бұрын
His interviewer gave him time to open the door , mine didn't even repeat the question 😭
@Akaash4492 жыл бұрын
While you're going left downwards, keep a variable successor pointed to prev node. So when you would need to go downward right do not change the value of successor until you find the node. Once you do find that check if that node has a right node or not or if it has whether its value is less than that of 'successor'. If yes then assign 'successor' to the right node, if no then 'successor' is already assigned to the correct node, no need to update it. Return successor. Problem solved. (Obviously check for NULL is done at each step and if NULL is encountered before reaching node -1 is returned).
@greenprobe Жыл бұрын
26:57 I think the candidate was suggesting something like `Node getMostLeft(Node x) { while (x.left != null) x = x.left; return x }`, which wouldn't require any additional pointers on the Node class and thus wouldn't interfere with the insertion method as the interviewer claimed. It's unfortunate that this insight was dismissed as incorrect since it would eliminate the overhead of the recursive call stack. I'm thinking a good way to handle this in the future might be to ask why an extra reference would be needed per node, or offer to write the iterative version to make sure both sides are discussing the same solution. Of course, it's very easy to come up with these approaches after the fact.
@OmarOmar-eo3pw Жыл бұрын
I have never had that helpful of an interviewer.
@TheGhost0944 жыл бұрын
Yet to meet a developer who actually used a Binary tree in his work
@iAdrianT4 жыл бұрын
The interviewer!
@berkantasci88112 жыл бұрын
Recently in an interview I was asked a similar question. Mine was a bit more complicated and I wasnt allowed to use any sources. The thing is I am a new graduate so I kind of messed it up and didnt get hired. I know it isnt the best way to evaluate my worth as a software engineer but still sucks to not get the job.
@BenDover-fv5sb2 жыл бұрын
Just mass apply bro. Any opportunity you see just go after it and grind grind leet code. Rn it’s rlly hard to get a job as a new grad but it’s up to your own will!
@thisisnotpublic6569 Жыл бұрын
I'm a Staff Software Engineer, been coding for 12 years and tackled a bunch of really complex problems. Having to code an algorithm for concepts like a BST is bullshit, unless you are being hired for really low level programming. It's no way to assess a candidate that will be doing higher level programming on a day to day basis. A bunch of juniors may be able to do it, as it's fresh in their mind from university. Scalability, identification of performance bottlenecks and how to deal with them as well as how to design maintainable code are way better ways to assess a candidate.
@denniskoeman309811 ай бұрын
Financial applications are really on the embedded/industrial/c/cpp low level, close to metal, close to high speed trading networking infrastructure side of stuff I guess
@MachiriReviews2 жыл бұрын
I finally get it. The best way to use a Binary Search Tree is to interview people. Truly an amazing data structure.
@valerixcrim37163 күн бұрын
This interviewer is really nice and patient. I have only gotten people with sticks up their rear ends, it would be nice to find a person how is kind and doesn't treat me like I owe them money.
@ilikememes9052 Жыл бұрын
The problem itself screaming to apply a inorder traversal on BST. As a fact, Inorder traversal of BST is always a sorted list of nodes so you just need to return the first node whose value is greater than input node. So next time use this fact. PS - I am just a student preparing for interviews
@brianmcmillan8143 Жыл бұрын
I thought the same thing at first but the time complexity on that solution will be O(n) since you have to traverse the entire tree. I’m not finished with the video yet but the solution of the video seems to cut down the iterations a lot by traversing based on a logic system
@ilikememes9052 Жыл бұрын
@@brianmcmillan8143 worst case time complexity will be always O(n) But yeah operation can be further cut down
@brianmcmillan8143 Жыл бұрын
@@ilikememes9052 yup !
@nevikgnehz3684 жыл бұрын
I was thinking these type of questions are rarely asked. Big yikes honestly haha.
@nathansire66233 жыл бұрын
50% ask these things. And 90% of startups fail.
@amitjoshi24543 жыл бұрын
I'm here from hated tarun😂😂
@prekshabharadwaj13513 жыл бұрын
This is what sadness looks like 😂
@aurumsilver18653 жыл бұрын
Me also 😂😂😂
@pritideepsahoo32553 жыл бұрын
Me also
@satheshkumar43173 жыл бұрын
Who is tarun
@doertedev3 жыл бұрын
This is a posterchild example for both the fact that search function coding tasks whilst paired and following complexity questions are nonsense. Thanks.
@ediponascimento5323 жыл бұрын
I liked it. They worked as a team. I think they enjoyed it already.
@cinematicsl2 жыл бұрын
I wish I had interviewers like him, so he can write half of my code. My interviewer would just sit idle and wait for my code to pass all test cases then he would simply say "Nah! You should have arrived at the solution much faster."
@zmazadi3 жыл бұрын
These type of interview are maybe fine for freshly graduated students but I have been working as software developer for 10 years and never used BST once. Obviously interview style and content should be relevant to the problems the job will be dealing with.
@vasum58663 жыл бұрын
Seeing that there is no preference for right or left, parent or child nodes maybe you should just flatten this tree into a hashmap, sort in increasing order and return the next node to the number given.
@huzaifakhan_7712 жыл бұрын
This is simple. Just do an inorder traversal and find the next value after the given value
@P0LGARIS6 ай бұрын
I believe a TDD approach would have helped a lot with the implementation, especially with the edge cases.
@Qalupatra4 жыл бұрын
Its not Bloomberg interview. Its Pramp interview who do mock interviews.