I memorized how to open the door to leave my home, memorized how to drive my car and then memorized to shake hands meeting the interviewer... On a pro-leet-level subconscious level
The two hardest to me: Why do you want work here? idk , you guys pay and I need money Where do you imagine yourself in 5 years? bro I don't even know where I'm gonna be the next month, let alone in 5 years.
is this really such a problem question? honestly seeing how some people react with such hostility to this question online seems like it's a pretty good way to filter out obnoxious arrogant twats who would be a nightmare to work with on a personal level alone
@nullyberd it wouldnt be that big of an issue if they dont always throw me out for accusing them of being a fed. I answered most of their questions, they can answer some of mine. "why do want to know me?" "what do you already know?" "who are you?" "who do you work for?"
This. It's like making every single car mechanic be tested only on the intricacies of the wiring harness in the car's electrical system. You could work in a shop for 20 years and never have to fix a wiring harness. And when you need to, you just copy and paste someone else's work (replace the harness). We can argue all day about whether mechanics are better when they know this detail. But practically, the whole requirement is just a show because HR people don't know what they're doing so they're just copying someone else's work. Oh hey...
That's what I always wondered! Entry level front end JavaScript developer and they want me to solve some super complex sorting algorithm? Why wouldn't I just call quicksort and move on with my life?
But most leetcode problems aren’t “complex algorithm” questions. They’re usually applying baseline concepts or fundamental algorithms to solve a problem. If you can recognize and apply design patterns and architectural solutions to problems, basic algorithms should be something you can already do or learn very quickly
when the pool of candidates already has so many people, why not get the one who performs the best. It's not like being able to solve a question is a disadvantage
@@hotrodhunk7389Because hiring managers don't know or can't anticipate what sort of coding you will actually do, so they just give to something hard as a proxy for skill.
- Pass an interview with complex algorithms - Start working - Use complex algorithms to improve performance - Get comments on code review "too complex, people will not understand how that works"
@@cyberpunkspike What an ignorant comment. web dev is not the only aspect of software engineering. Try working game dev and not prioritizing Performance
@@Bea-ou5qw define seasoned. Have you made anything that has to serve millions of players with zero downtime? Do you write your own shaders, pathfinding for your AI or do you just drag and drop in unity and unreal engine. People throwing around the word seasoned when they just copy paste code from stackoverflow and build their games with controllers and assets from unity store
Skill you spend the most effort on in college software engineering: Calculus. Hardest test in interviews: Insanely specific domain knowledge and algorithms. 99.9% of programming jobs: Trying to slowly explain to a manager why what they're asking for is not only a logical contradiction, and impossible, but if it were possible it would be a terrible idea. There is close to 0 crossover between these domains.
We generally learnt about Calculus in Year 1 and 2, and then we didn't touch it much for years 3 and 4, and the numerous techniques and formulae wither away in my mind with each passing day. Should have taken the optional course on Digital Signal And Image Processing in Year 3, it had more calculus.
I 'll do you one better. Reach the point where your day to day job is fighting over budget, potential project scope expansions, writing documents (not strictly technical ones) and high level documentation for others to actually sit down, break it into tickets and then actually go ahead and implement shit. I am considered a "principal engineer" (whatever this means) in my current employment . The only coding I do is at the evening when I have the time and/or inclination to study - and this gets worse as time passes by.
I'm a mathematician and I disagree. He compares bootcamp vs learning programming at college. The summary is, in math, engineering is a bootcamp and BSc in math is college. I understand that he doesn't know real math (just like bootcamp people just know superficial stuff about programming). But he should know he comes from a very different context so he doesn't have all the information.
I feel like most people totally misunderstood neetcode's point. The original justification for it being used for interviews was that it showed a candidate's logical reasoning skills and understanding of core CS concepts. That's why it would hypothetically be a good way to evaluate someone. But then people just started memorizing everything, and so it became an arms race where everyone has to memorize everything to be competetive, and so now it doesn't serve as a measure of logical reasoning or high level CS fundamental, it's just a measure of who studied the hardest. Which, for better or for worse, is just a fundamentally different measurement. It'd kinda like if you could massively improve your score by studying for an IQ test. It wouldn't really be an IQ test anymore. It would still measure... something. But it wouldn't be measuring IQ.
Spoiler alert: You can increase your score on an IQ test by studying for it.. it has been proven and that is why IQ tests (at least the standard Ravens Matrices and that shit) is largely useless unless it's the candidates first time doing them (and it won't be)
Straight on point, I recently took an Online coding test after taking DSA more than 4 years ago. Literally never tried leetcoding before. Was able to get through the frist half of the tests. Even though I did not "pass" all the tests, I felt proud that I was able to figure it out without even doing a warm up. It showed to me I could figure stuff I have never seen before out on the fly with the basics I learn back in my bachelors. But again because of competition you now have to grind leetcode and be able to quickly remember how you solved a similar question instead of presumably figuring out a question you have never seen before.
So in reality, not much different than any exam in school too. Some people memorize and score 99% on the test, but if you gave them a box of components, a power supply, and an oscilloscope, they couldn't build you basic circuits to save their life (I'm talking about EE courses) - so wtf was the exam actually measuring? Mostly the ability to take an exam
Interviewing now and even 5 years ago is a day and night difference. I say this as someone that's been in the industry and now being involved the process.
@@kaleoscreations sometimes you're expected to solve 2 leetcode hards in 45 minutes with dry run with your own test cases, explaining the brute force methods and the optimizations, after that you will go through a system design interview where you have to design really complex systems in 45 minutes. If you do well in these 2 pray you don';t fck up in any behavioral question bcs they will discard you.
26:33 One thing I realized about dynamic programming that made it a lot easier was realizing you're just building a map of function inputs to outputs based on previously found mappings. When learning it, I think it would have been more obvious if I had been shown an example problem where you just recursively jam everything into a hash map with the keys being the input of the function and the values being the output of the function. Instead, I had to try to wrap my head around "optimal substructure," "loop invariants," and clever array manipulations before I could even understand what was going on. Those are important, but I think it can be overwhelming at first and makes people lose sight of what the algorithm is actually doing. All the array stuff and loops are just optimizations.
For example, coin changer II can be solved like what's below in 14 lines and only 1 is doing heavy lifting. It's by no means the fastest way to solve it, but for understanding the essential parts of dynamic programming, I think it's more straightforward. All you have to for this problem is initialize your data structures, define your base cases, define what to do if you've seen the inputs before, then define what to do if you haven't seen the inputs before and store the result into the map of seen cases. class Solution(object): def change(self, amount, coins): return self.change_recursive(amount, sorted(coins), len(coins), {}) def change_recursive(self, amount, coins, coins_considered, solved): inputs = (amount, coins_considered) if amount == 0: return 1 if amount < coins[0]: return 0 if inputs in solved: return solved[inputs] solved[inputs] = sum(self.change_recursive(amount - coins[c], coins, c + 1, solved) for c in range(coins_considered)) return solved[inputs]
@@JensUwe-24 The paper I was reading when I realized the broader perspective on memoization and dynamic programming was "An Introduction to Binary Decision Diagrams" by Henrik Reif Andersen. It shows off the same hash map trick. Implementing the ROBDD data structure along side that paper was an insightful experience for me because it's a bit different from the common examples used to introduce the topic of dynamic programming. I don't really have specific resources besides that. If you want to search for some, a succinct phrase for the concept might be top-down dynamic programming with hash maps for memoization. It's basically normal recursion, but the hash maps make repeat calls be O(1). If you're asking about dynamic programming generally, I would first suggest a data structures and algorithms course comparable to what an undergraduate would take toward the end of their degree.
I like how my current workplace does coding interviews. They give you a project before your interview, and you work on a solution, and then present it at the interview. This is a more realistic way to measure how good someone is at doing stuff you would be doing at work. At work you won't be solving algorithm problems from your head, you'll work on a project, and have the ability to look at documentation, look online, etc.
It’s cool if one or two places are doing this but if ever did that most people would only have the time to apply to 1-3 jobs a week (assuming they are currently not unemployed)
I was a math major. At the higher levels, 90% of the time is spent just banging your head against the wall for days trying to understand abstract concepts. If that doesn't prepare you to become a good programmer I don't know what would.
I'll almost disagree. Most of my time in upper div math was spent doing proofs/derivations. Reinventing the wheel to arrive at the tool I actually want. In programming, I find myself constantly reinventing wheels and it's a big waste of time (especially when the wheel I invented wasn't as good as the one already there).
Banging your head against any problem for days will put you on path to being fired. Management wants results, not excuses. It would make you a good programmer, just a homeless one.
@@VinceOfAllTrades I think he's referring to Prime's comparison to farmers where he said that because farmers work "harder", they're more likely to be better programmers.
5:30 No its so true - why would i want to work somewhere that gatekeeps on weird recall of esoteric knowledge instead of somewhere that just wants to see me work through a few more or less "normal" engineering problems
13:35 people deal with algorithms daily. Idk what a farmer does, but I worked with people that had to move things around, construct tents or whatever, and I heard them talk about the best way to do it. It always involved their experience observing what is the fastest way to solve that problem. Be it build tents on a set area, with X amount of people, mowing the lawn with X amount of people and so on.
Prime keeps defending the status quo when asked about tech interviews when the status quo is infact in question! Yes you're going to pass an interview if you prepare for the bull shit they're going to throw at you but people are arguing that maybe there should be a better way than that.
I'm so used to those being hard questions that at first I thought he meant "how would you implement a parser for a CSS selector and the DOM traversal for updating it if you were building a browser?"
@@brownie1035 No, I think it was literally just write it like you would in the browser, e.g. "div > *" Something so trivial that it's a joke that it was in an interview at all.
@@ttheguyy Only in U.S. because in developing nations you'll have to be sufficient to do the job and that's it! Again Economics is KING it's a DEMAND and SUPPLY issue there are too many programmers and less jobs every year! Wait it's all about DEMAND and SUPPLY..........Always has been!
One thing about kids "that just get it". I was one of them and I barely studied for anything if at all, as a result I never really learned how to study, which was a critical skill later in HS and After HS. I struggled, and I assume some like me did, too.
Same. Turns out I was not challenged enough in school. I never had to learn math, never. I never prepared myself for exams. Then in college I realized there are some hard math problems out there.
Yeah, what do you know, HS is a waste of time (because it's way too simple, and you're moving at the pace of the statistically slowest kid over the last 15 years that they based the curriculum over). I learned how to study in university, and even there, I didn't have to put that much work into the CS courses, it was the math and EE courses that were actually hard
Anyone else notice that in prime’s first rant kind of misunderstood his point? Pretty sure the guy in the video was trying to say that the general view around leetcode is that if you do it enough you’ll be able to solve any algorithm just like famous mathematicians.
Yea, and this opinion is somehow echoed on cscq. Some interviewers on reddit repeatedly say, "I fail candidates who memorized the algorithm, I want to see people come up with a thought process on their own." Even though the number of candidates who can do that are very slim. What they really mean, is "candidates who bullshit me into believing it."
@@kirby145x Those interviewers are right, anyone who can't explain their reasoning for easy/medium questions is a bad programmer who just memorized algorithms and cant actually code. You don't need a PhD to explain how inverting a binary tree works.
2min and 3sec into this video and I'm yelling into the keyboard.... When I was 20 I interviewed at microsoft, did not get the got, but my answer to an interview question ended up in the code. When I was 24 I interview at Intel and was asked how much code I write in a year... at that time about 30-50K lines. The interviewer called BS and I never got the job. Years later I was converted over 2M lines of code from 18bit to 32bit for IBM in both c and assembler in less than a month. I interviewed at Amazon and asked to design a wordprocessor/texteditor at the time I was building high speed banking/payment systems. At the end of the day I get stupid questions from interviewers who do not understand that their job is to find highly qualified people not to act as gatekeepers. If Dikstra's algorithm is on an interview question then you should leave.
Prime needs to learn to STFU sometimes. He made it 36 seconds into the video before pausing and then rambled about nothing for 5+ minutes, of course he missed the point.
Binary search is surprisingly difficult to implement. While the concept is really simple, there are 5 places where you can make off-by-one error, one place where you can get an overflow, one special case you might forget about, one check you might forget about. And there is also one way to implement it that works, but does an extra operation inside the loop that can be brought outside. Devil is in the details.
So you just import a library or call a function. If all your programmers are reinventing the wheel every time, your code is a security nightmare and impossible to maintain. Asterisk, maybe you're a senior engineer at Intel designing a new CPU. You need your algorithms to be cycle perfect. Meanwhile, there are 100 marketing people working at all the vendors trying to sell your chips. They just need the website to display in a reasonable time. And getting it tighter relies more on things like caching than algorithm optimization. If a page takes 6 seconds to load the first time, but then gets cached for the next million views, who cares.
@@KevinJDildonik In interviews, I asked to implement "overlap(a,b,c,d)" where a and b are respectively the lower and upper bound of the first range and c and d are respectively the lower and upper bound of the second range. So, they don't even need to validate that. Yet, most programmer fail to write good code. And there are plenty of libraries for hat, yet, if they can't write such a simple code (it's a one liner), they certainly can't think about more involved problems where you need to use two or three libraries the right way.... And to top it, in my field (Tree to tree transformation driven by trees), custom made algorithms are a daily thing. And no, I won't be asking a dev to do something we do on the job, because I don't have 2 weeks of interview ^^
@@programaths I'm fairly sure you elaborate more in interviews about what overlap is actually supposed to do, but it's not immediately obvious here whether it's just supposed to be a range check if there is an overlap or whether it is supposed to produce an overlapping of both ranges. In first case, I would challenge you on the ambiguous name and in both cases, it would actually be better to reduce it from 4 parameters to 2. It's also important to note whether calls to that function can be assumed to be well-formed or not, otherwise it's definitely not a one-liner anymore and I would also tell you that if the solution is a one-liner, it's bad to have this function in the first place as it's just pointless indirection. All the reasons why I think such interview questions, if they actually aim to get "the correct solution", are just futile.
I live in a barn, work on a farm, and program in my free time. Before covid, I worked with children for a living. This rant was made for me, haha. Can confirm it's all true.
When the company i work for got bought by a VC, the management consultants that took over for a while forced us to ask how a C# dictionary works internally, and solve a riddle about coloured balls. If someone chooses to implement their own dictionary instead of using the built in, i don't want to work with that person. Now we only do conversations in interviews and it works really well.
Prime tends to mock chat for saying "well ackshually" and finding an exception for everything, but he is doing exactly the same thing over and over again. On top of that the meaning went over his head and he went on a tangent, that does not address to point at all. From your point of view it is not cheating, because you are approaching it from the angle that interview is meant to check if you know certain algorithm or not, and as you said - this is not helpful. And this is not helpful, because checking if you know it shouldn't be the intention (but sometimes it sadly is). For someone new, who is just trying to do learn to do his job, it all looks like he should be smart enough to derive this algorithm just purely with is intelligence. Not that he should learn it, because you don't need it on the actual job, just that you should be smart enough to make it yourself. And interviews are making it look like this is the case, not to check if he knows it, but if he is smart enough. This is why he called it "cheating". It is not cheating like in school for example, where you have external source of knowledge to pass the test. It is cheating because you are memorizing the algorithm, that is intended to check if you are smart enough to come up with it on your own. Do you get it now?
The game being played by many interviewrs: ask a hard question, watch the regurgitation, move on to the next. Especially for junior/entry level jobs. "Weird Twitter takes" are how very many interviewers think theyre supposed to conduct the interview these days.
Just starting getting to your rebuttal of his first point; I think he's meaning you have to already know the answer going in, it's not really something a usual person could derive without just knowing the answer. Say the cycle detection trick, the normal first thought is to keep a list of pointers and check against that, not the turtle and rabbit race -- unless you've studied the question and knowthe answer upfront now, so equivalent to peeking to someone elses solution on an exam. Although wouldnt count that as actual cheating cause knowledge sharing is aprt of programmer culture and algos are a thing that circulate but I get what he means
It is so funny for people to be super enthusiastic about algorithmic shit. Yet, in real life, most enterprise programming is writing code about talking to a database and saving events for marketing. Normal everyday tasks aren't about solving traveling salesman or making the most of sorting but "how to make this box highlight on hover".
This whole shit circles back to companies separating the actual programmers from hiring (edit: and instead delegating hiring to HR), so you get bullet point questions and answers
I love when Prime nitpicks an argument that he didn't understood for 30 minutes straight and gets angry at chat for pointing the fact that he didn't understood the very simple premise. That's exactly why I come here, to get angry.
9:20 That's definitely not how I would calculate 55*32! Here is how I calculate it: (In my head! No paper required.) 55*2 = 110 3 * 55 = (2 + 1) * 55 = 110 + 55 = 165 1650 +110 = 1760
Math vs farmer point is absolutely true. I told a friend about TOP (He left his math degree at Oxford due to finances) and after only 4 months he was working and already extremely proficient with coding. Vs my other friends who got into coding but had unrelated experiences to problem solving, which took them years to get into it.
while im far from the worst at math & that ive come to realize that math is basically the oldest programming language (it has operators, including logical operators, sequence types, constants, algorithms & functions too) it doesn't mean that being good at it automatically makes you a better programmer, in my experience, the illusion of "extreme proficiency" in programming is largely dictated by the tools/environment & language used, with exception to some programmers. while they share some stuff in common, they are entirely different skill sets at the end of the day.
@@anon-fz2bo you can't deny that it helps a lot if you are good at advanced maths, though I must say being "skill hungry" is probably a much stronger indicator if you are going to be good or bad at programming
@@C4CH3Sim not sure i agree entirely with your first statement, imo its not as simple as a binary answer, its deeper than a yes or no as it depends on a multitude of factors. but i do agree with your second statement. in any case im just glad i find math interesting & easy for the most part, same thing with programming although i love the latter much, much more 😂
Eh.. I think that's a pretty classic case of correlation not causation. I don't think anyone would argue that people who are good at math also happen to be good at coding - there's a lot of overlap in the thought processes required for those things.. but that doesn't mean the things that they learned are necessarily that meaningful - they probably would've found it rather easy to learn coding even if they didn't have a higher education in math just based on their innate talents.
@@anon-fz2bo math is the base of EVERYTHING. If you know real math (how to proof stuff, how to understand your problem and so on), you can go anywhere you want. But in engineering they only learn how to use stuff, not how to create math. That's a big common intersection between CS (with a strong basis in math btw) and math (the real one, not the one in engineering. That is practical, but not the whole thing. Engineering is like the bootcamp of math).
A* is the same as Dijstra's, but at each step instead of computing the raw distance you compute the raw distance and the heuristic and add them up. You explore the node with the minimum sum first and add it to the explored list. If you have 2 nodes exactly the same, you choose an arbitrary tie breaker like LIFO or FIFO and be consistent with it. There are 3 versions of A* and only 2 are relevant. Version 1 works with an admissible heuristic, but doesnt care if it is non-decreasing, but can lead to loops and other weird stuff. Version 3 works only if it is non-decreasing (and admissible. Non-decreasing or whatever it is called, implies admissibility). It involves a heap and visited list. I may be misrembering some details, but we just had an exam over this topic a month ago.
0:38 Interview Questions, Disagree with Prime some interview questions are trivia ( Algorythm X that they dont even use in the product they intend you to be working on) designed to destroy your confindence when it comes to asking for salary 10:26 The Intersection. Agree with Prime, its not true An non-farmer mathematician will most likely fail to get a good yield while a non-math farmer will most likely fail to solve laplace poison equation. That doesnt mean they dont understand algo thinking. They each have their own unique way to approach a problem and break it down in smaller pieces and then handle them 1by1. For intersection with IT Software. IT Software is not creating specs, it implements them. An Agriculture App will be better with input from Farmers, while a Math app will be better with input Mathematicians. Also, please stop saying IT is MATH, just because it is not. Just search "How Computers Calculate" and see that, in itself, MATH is an implementation, not a built-in feature.
@@RaveYoda Maybe I didnt express myself right so let me rephrase it. The way I see it, the interview is meant to uncover which skills you are lacking or not proficient in relation to the position you apply for. Every single one that you don't fulfil or partly fulfill will diminish your negotiaton power. Therfore when you reach the interview question, "What are you're salary expectations ?", depending on the answer, they can low-ball you for each and every one, as well as what you have written in your CV. Some companies would go as far as offeringe the minimum wage when you check 9/10, taking advantage of the fact that you are a junior with no work experience. And they wonder why juniors leave once they get work experience.
My degree was in Information Systems with management and accounting subjects. We didn't have a single algorithm subject. didn't need it cause the degree was focused on getting you ready for a corporate IT/Software job. Only math I learned was in the accounting subjects. And I've never felt like it negatively impacted my work. because my degree taught me stuff that is actually useful in a real job, not just in the lab.
I wish they asked these kind of questions: Can you build us a scalable, bug free, good looking, performant frontend with React? To which I would say yes and that it would take me about a month to have a working prototype, then I would deliver, because that's where my skill lies and then I would be hired. But it does not work this way for some reason.
I derived the 2 heap running median solution on the spot for a DRW interview in 2017 and didn't get the job. Sure, that was an impressive problem solving feat by me, but the signal gets clouded by other interviewees who are over-prepared. Being smart won't get you to the head of the Leetcode queue unless you're O(n!) smart or you do the prep(*cheating*). And don't invalidate Neetcode's point cause you define cheating a little differently my guy.
The issue with leetcode problems is there are so many that are total bs that it’s hard to filter out which problems are reasonable and which are some stupid ass bit manipulation or dynamic programming trick. I work on a problem only to find out the solution was some gimmick crap thing
yeah, this happened with me, took me a whole day to realize I was not gonna solve the convex hull problem, did lots of brainstorming, still didn't get anywhere, at last I just had to look at the solution and it was like the gimmick crap thing that you just mentioned.
All search algorithms like Uniform (aka dijkstra), A*, DFS, and BFS are actually the same algorithm, except for the container that you are using to keep track of open/not explored nodes. Uniform search has a priority queue, and the priority is given by cost to current node + cost to the adjacent ones. BFS just throws all nodes in a fifo queue. DFS just throws all nodes to a stack. A* modifies uniform search with a heuristic to change the priority in the queue.
Well, I watched 20 minutes of this, and I still have no idea what's their opinions on LeetCode. Probably it's not important at all, because the original video starts with some take on school level math, and the reaction video goes into lengthy discussions about intellect.
Summarize: you should not try to memorize leetcode problems to past the interview, instead use it to practice the core concepts of programming. It’s the correct goal of leetcode. Thats is what i got. Btw, farmer will surpass mathematic people in a long run
I crammed this multiplication algorithm from childhood up until late middle school, after learning about factorisation I did something similar and understood why this worked, that day I understood schools are not teaching things that they should be teaching.
@@briankarcher8338 I don't get how you concluded "teach algebra to 3rd graders". I don't know about other countries' education systems but in India it's pretty bad, most of the schools/teachers just teach you to cram formulas. I had had great teachers, one of my teachers taught high school mathematics (calculus) like it was literature, they created a story around it, how it was developed, why we use it, where to use it, he even derived certain formulas, I really liked this type of teaching.
There's not just one answer to A*. You can speed it up significantly by side-caring the node lookup inside the main algo. I derived that solution when I was working with huge maps of geological data, but it turns out it was already published in a Graphics Gems book. You can also do post-processing to clean up the path by using line of sight for arial vehicles and traversal checks for land based vehicles that have a gradient limit. For every point, you see how far you can get down the line going straight to it and then chop out everything in between.
The thing with the farmers vs mathematicians comparison is that I don't think being a farmer has any notable correlation with programming related skills. I didn't research anything, but my impression is that farmers usually become farmers through heritage, and if that's true, then it means that their skills affinities are not predictable well with their job, since for most technical jobs, people only apply if they had enough affinity and curiosity to spend enough time with, otherwise they'd just go do something else they like better. Of course this is not always true, but it is somewhat of a tendency. So that said, I'd assume farmers to have approximately the same average affinity to programming as the average living person, with the additional hard working ethic. At the same time I'd assume that mathematicians on average have higher affinity compared to the average living person. I don't think the "hard work" could overcome the affinity here, because affinity somewhat correlates with enjoyment, which results in less effort when "learning", while also requiring less time due to said affinity. That said, while I don't think farmers on average would overcome mathematicians in programming skill under any time frame, I do think that farmers would probably be a more desirable candidate for a programming job, because you don't need everyone to be a great programmer in a team. Having a few great ones, providing the general path and some okay, but very deligent ones probably yields a higher work efficiency over all (which is partially why companies hire non-senior level people at all, not all work is extremely complicated, sometimes it's just annoying and long)
btw The fastes way to multiply 55*32 is to shift it left by 5 times because 32 is binary value 100000 which is 1 (0b1) shifted 5 time to be 32 =0b100000; Same way like multiplying by 10 in decimal system means sign zero to the value so in binary world, multiplying by 2 means to sign 0 at the end to the value; mov eax,55 shl eax,5 now eax holds result: 0b11011100000 or 0x6e0 or as you wish decimal 1760 shl eax,5 0b110111
Inverse trig substitution is mostly a contrived thing. Its only really for nice polynomials. And by nice I mean second order... like you can't solve a 3rd let alone 5th order polynomials with it
0:39 I interviewed with Amazon (back when they flew you out to WA for it), and the dude wanted me to implement an LRU cache from scratch. He made sure I didn't know what it was beforehand. When I got home, I looked it up and discovered that it was indeed one of those algorithms written as a thesis by a genius. Gimme a break. Even the genius who wrote the algorithm couldn't come up with that in a 50 min interview.
Fellow DSA specialists, which language is best to learn/use for DSA stuff? Does it matter at all or would it make sense to use something like C over Python due the large amount of helper functions built into Python? Or is it something you can still use Python for, but everything you do is from scratch? (Please don't bash me for my lack of knowledge in the area, I just wanna level up.) Edit: BTW I'm gonna check out neetcode and leetcode and get more familiar with the stuff in the meantime but feel free to reply and leave suggestions
want to test the coding interview? - implement the BigDecimal - create datepicker with only pure html javascript css + copy paste text - create a decimal textbox that user type only number but show delimiter as preferences + copy pasted value
I think farmers who have gone to college in the past have made some of the best engineers and likely also programmers. Not one myself, but have known some farmer and farmer-adjacent folks who can build a car from scrap materials as a side project, definitely think it's a good idea to get your kids into hands on tooling if you can.
I got a question that took a 2 hour long graduate cryptography lecture to explain and is a backgracking hard that is leetcode #2000-something. Some interviews really are stupidly difficult. I got another really tricky priority queue question recently that was a medium to a hard 2 weeks back.
Here's how I memorize Dijkstra and A*. BFS is a special case of Dijkstra when the weights of all the edges are the same. Dijkstra is a special case of A* when the heuristic function (I like to call it the penalty function) always returns 0. Since I'm comfortable with BFS, I can improvise Dijkstra and A* when I need them.
One time I had a group interview and the interviewer literally pulled out a bunch of play-doh, handed everyone a container, and said "okay you got 5 minutes to make whatever you feel like making then explain why you made it." It was a valet job parking cars at a hotel.... stupidest interview I've ever attended.
I WAS a math superstar in grade school, I fixed cars and worked in motorsport. Which IS a lot of numbers, but I still forgot almost everything long before I decided to study CS. It's always hilarious to me when math shortcuts is strongly associated with problem solving (it is obviously), but a LOT of math gooners don't have other critical thinking skills. Like you can measure one of those block puzzle tests and figure out your inverses, but flipping them around and eyeballing the boundary will get you to the solution faster if you systematically flip things that look like they'll fit. Which is technically ratios like poker, but you're not actually doing math. The way I was raised is that being a "master of none" is generally better. Same thing with memorization, just be able to GET the information you need without having to research.
Like bubble sort specifically, or not even selection sort or insertion sort? Even out of the quadratic sorting algorithms, bubble sort is the least useful one. Unless you expect them to be teachers, sort data stored on tape drives, or do arcane graphics optimisations, there's no reason for them to have even its basic principle memorised.
There is variation in cognitive abilities among individuals, but also among races. Or do you think we can differ in skin color and bone structure, but the brain is the same?
Farming was the worst example it requires constant problem solving. As a developer + farmer there are so many parallels between farm management and software development
yea people forget that the progressive scan television was invented by a farmer. the only dumb thing about a farmer is them being willing.to accept what is ludicrously low pay given the amount of work involved
I constantly feel insecure about my programming abilities but having prime say dynamic programming is hard made me feel a little better cause I actually feel confident with that and coin change
Memory works best in a linear fashion. Each thing can lead to another. We dpn't know how the neurons work on a fundamental level, but it probably has more to do with order. We literally have spatial memory. It's 3D.
I actually did derive Dijkstra's algorithm on my own (albeit: when applied to a tiled grid, at least, which is a more obvious/limited use case), I was just working on a maze-game for a final project in highschool and it seemed intuitive to me when I was checking that each maze had a valid solution that wasn't too short - I needed to measure the optimal solution's distance. Only realized it was some special algorithm that people are taught several years later when I was in Uni. Thankfully though that question is still a gimme for me in interviews, ahaha. I agree very much though with Prime's first counterpoint at the very beginning. And I generally agree that memorization of googleable issues is an awful way to measure a candidate's quality.
@@Night_Hawk_475 That's the point though, what Neetcode was saying is that you're not going to derive these algorithms during an interview, you just need to know it.
Just got done with data structures class, and while completely eye opening, and using leet code to see how things work, or dutch national flag problem. Find interesting ones, break em down, add to the original leet code problem, and move on. Theres so much to learn, and you should have a solid foundation in algorithms, dont think interviews are just algos. Its a part of it, but not more of a check system rather than the mega defining factor.
As a farmer/programmer I can agree that mathematicians would have an advantage in learning programming but after I understood problem solving it was like opening the floodgates. Very rewarding to learn.
yeah I'm from such a location. When I went to uni they classified me and my friends as "can't possibly finish uni" and we were second hand students in any lab or class room from day 1.
The math (pure maths) background it's really useful because you have to memorize and practice a lot buuut at the same time learning how to do proofs, and how proofs works. I remember trying to memorize proofs on my first year and on my second year I was already reverse engineering proof results to arrange the proofs. Why do the author of the book chose epsilon to be less than (b-a)/2*arctan(mass of the sun)? It's not magic it's a process that you have to do aswell to understand how everything works, and that's learning at its peak
I loved English because their is a definite answer depending on what they say to use to get the answer. It also makes my adhd brain happy as each step along the way I get satisfaction. I found English lit hard due to the fact that yes their is kinda a right answer but it’s all about how you explain it and it’s built on abstract ideas that my younger brain couldn’t compute at the time. Also writing didn’t give my adhd brain what it wanted and actually felt like a chore. I have more of a logical brain than a creative brain due to me having Aphantasia and I always felt that I couldn’t visualise what was being said in say a book to extrapolate the meaning. Whereas with numbers they are a set thing that I learned and felt comfortable doing. I think that’s now why I love code so much. I get adhd happy Chems and can be a little creative whilst still being very logical.
Always bet on the farmers! I was teaching a few courses at a local university for the Agricultural Mechanization program and their learning speed for PLC programming and electrical circuits was impressive. We were able to go into much more advanced topics over the required core.
Google interview 12 years ago? Well there’s your problem. These days it’s just leetcode hards man. It’s not let’s have a conversation about walking a tree.
I think Neetcode refers to leetcode questions where the bar has been raised so high that interviewers start seeing the more complex solution like in "Top K Frequent Elements" where the logical answer is you use a heap and return k elements, or use bucket sort but then there's people that know the Hoare's sort and I'm not learning that by memory (now). When I have to remember so many other important patterns first. Also, I believe people cheat mostly in OA's I believe that's where Neetcode refers to cheating. In an in-person interview you can't cheat. You memorized? Sweet, that's advantage to you and good for you. But I can see what Neetcode says where the initial screening interview I had to solve some medium to hard leetcode questions. I won't complain, it is what it is, I'll just practice more, but it is definitely getting harder.
No one taught me data structures and algorithms in school or work. That’s why I ask people where do I learn how to learn things the way leetcode and advent expect people to have learned how to learn?
I agree with 95% of this .. until the point where you say that dsa is 'not easy' and that's why it's paid so well. I tend to believe it is easy and I don't think this industry is 'paid well'. This is something that everyone likes to say but in my experience I have friends who make a lot more money than I do as an engineer.
I remember an take home interview I had, the guy said from your cv you don't know rust but you seem smart, we use rust so you gotta do the assignment in rust. Here is 24 hours do it and we will examine the code. Was so fun trying to figure out how to write rust with a python background. Then got rejected on the grounds of terrible code lmao
I CHEAT ALL THE TIME, I MEMORIZED ENGLISH TO UNDERSTAND THE INTERVIEWER AND GOT AWAY WITH IT
I memorized how to open the door to leave my home, memorized how to drive my car and then memorized to shake hands meeting the interviewer... On a pro-leet-level subconscious level
@@Dominik-K I memeorized both at the age of 8.
So true especially if you speak multiple languages. I have to "cheat" by learning how different consepts are translated into English and back.
You joke but there’s like a French Scrabble champion that doesn’t speak one bit of French.
@@xtrct7303I guess for Scrabble you don't have to know grammar or what things mean. You just work off patterns.
I hate when they throw curve balls like "tell me about yourself". Darn gate keepers.
Just say it's in your CV. If they haven't bothered to read it, you can quit the interview anyway.
Actually out of all the interviews I've done in my life, this is one of the hardest questions.
The two hardest to me:
Why do you want work here? idk , you guys pay and I need money
Where do you imagine yourself in 5 years? bro I don't even know where I'm gonna be the next month, let alone in 5 years.
is this really such a problem question? honestly seeing how some people react with such hostility to this question online seems like it's a pretty good way to filter out obnoxious arrogant twats who would be a nightmare to work with on a personal level alone
@nullyberd it wouldnt be that big of an issue if they dont always throw me out for accusing them of being a fed. I answered most of their questions, they can answer some of mine.
"why do want to know me?"
"what do you already know?"
"who are you?"
"who do you work for?"
Most coding jobs that include complex algorithm in the interview questions are for jobs that have nothing to do with complex algorithm.
This. It's like making every single car mechanic be tested only on the intricacies of the wiring harness in the car's electrical system. You could work in a shop for 20 years and never have to fix a wiring harness. And when you need to, you just copy and paste someone else's work (replace the harness).
We can argue all day about whether mechanics are better when they know this detail. But practically, the whole requirement is just a show because HR people don't know what they're doing so they're just copying someone else's work. Oh hey...
That's what I always wondered! Entry level front end JavaScript developer and they want me to solve some super complex sorting algorithm? Why wouldn't I just call quicksort and move on with my life?
But most leetcode problems aren’t “complex algorithm” questions. They’re usually applying baseline concepts or fundamental algorithms to solve a problem.
If you can recognize and apply design patterns and architectural solutions to problems, basic algorithms should be something you can already do or learn very quickly
when the pool of candidates already has so many people, why not get the one who performs the best. It's not like being able to solve a question is a disadvantage
@@hotrodhunk7389Because hiring managers don't know or can't anticipate what sort of coding you will actually do, so they just give to something hard as a proxy for skill.
LET HIM COOK 🍳
😂😂😂😂
🤣 yess
MY GUY!!!
exactly my thoughts 🤣🤣
bro cooked!!
- Pass an interview with complex algorithms
- Start working
- Use complex algorithms to improve performance
- Get comments on code review "too complex, people will not understand how that works"
😂😂😂 just use library function
Correct, which is why leetcode is bullshit.
@@cyberpunkspike What an ignorant comment.
web dev is not the only aspect of software engineering. Try working game dev and not prioritizing Performance
@@engine_man as a seasoned game dev I can confidently say you don't need necessarily leetcode or complex algorithms to make a performant game.
@@Bea-ou5qw define seasoned. Have you made anything that has to serve millions of players with zero downtime? Do you write your own shaders, pathfinding for your AI or do you just drag and drop in unity and unreal engine. People throwing around the word seasoned when they just copy paste code from stackoverflow and build their games with controllers and assets from unity store
Skill you spend the most effort on in college software engineering: Calculus. Hardest test in interviews: Insanely specific domain knowledge and algorithms. 99.9% of programming jobs: Trying to slowly explain to a manager why what they're asking for is not only a logical contradiction, and impossible, but if it were possible it would be a terrible idea. There is close to 0 crossover between these domains.
lol what kind of programming jobs do you guys have
We generally learnt about Calculus in Year 1 and 2, and then we didn't touch it much for years 3 and 4, and the numerous techniques and formulae wither away in my mind with each passing day.
Should have taken the optional course on Digital Signal And Image Processing in Year 3, it had more calculus.
@@thebrahmnicboyYeah DSP, ML and simulations. Lot of calculus in those
Yea and that is the problem.
I 'll do you one better. Reach the point where your day to day job is fighting over budget, potential project scope expansions, writing documents (not strictly technical ones) and high level documentation for others to actually sit down, break it into tickets and then actually go ahead and implement shit. I am considered a "principal engineer" (whatever this means) in my current employment . The only coding I do is at the evening when I have the time and/or inclination to study - and this gets worse as time passes by.
The "Moral of the story, do math on a farm." chat killed me, lol.
I'm a mathematician and I disagree. He compares bootcamp vs learning programming at college. The summary is, in math, engineering is a bootcamp and BSc in math is college. I understand that he doesn't know real math (just like bootcamp people just know superficial stuff about programming). But he should know he comes from a very different context so he doesn't have all the information.
@@AlejandroMéndez-j6j Holy hell dude, laugh at a joke...
@@AlejandroMéndez-j6j Or it is possible there's an ego or other intrinsic factor that is warping your perspective.
Shit are you alright now?
🤣
I feel like most people totally misunderstood neetcode's point. The original justification for it being used for interviews was that it showed a candidate's logical reasoning skills and understanding of core CS concepts. That's why it would hypothetically be a good way to evaluate someone. But then people just started memorizing everything, and so it became an arms race where everyone has to memorize everything to be competetive, and so now it doesn't serve as a measure of logical reasoning or high level CS fundamental, it's just a measure of who studied the hardest. Which, for better or for worse, is just a fundamentally different measurement. It'd kinda like if you could massively improve your score by studying for an IQ test. It wouldn't really be an IQ test anymore. It would still measure... something. But it wouldn't be measuring IQ.
Spoiler alert: You can increase your score on an IQ test by studying for it.. it has been proven and that is why IQ tests (at least the standard Ravens Matrices and that shit) is largely useless unless it's the candidates first time doing them (and it won't be)
finally someone who got the point
Straight on point, I recently took an Online coding test after taking DSA more than 4 years ago. Literally never tried leetcoding before. Was able to get through the frist half of the tests. Even though I did not "pass" all the tests, I felt proud that I was able to figure it out without even doing a warm up. It showed to me I could figure stuff I have never seen before out on the fly with the basics I learn back in my bachelors. But again because of competition you now have to grind leetcode and be able to quickly remember how you solved a similar question instead of presumably figuring out a question you have never seen before.
So in reality, not much different than any exam in school too. Some people memorize and score 99% on the test, but if you gave them a box of components, a power supply, and an oscilloscope, they couldn't build you basic circuits to save their life (I'm talking about EE courses) - so wtf was the exam actually measuring? Mostly the ability to take an exam
You absolutely can study for an IQ test lol
Interviewing now and even 5 years ago is a day and night difference. I say this as someone that's been in the industry and now being involved the process.
☝🏼 This is the most accurate comment on this post.
@elremolino707harder baby
I haven't interviewed in 6 years. What has changed?
@@kaleoscreations sometimes you're expected to solve 2 leetcode hards in 45 minutes with dry run with your own test cases, explaining the brute force methods and the optimizations, after that you will go through a system design interview where you have to design really complex systems in 45 minutes. If you do well in these 2 pray you don';t fck up in any behavioral question bcs they will discard you.
26:33 One thing I realized about dynamic programming that made it a lot easier was realizing you're just building a map of function inputs to outputs based on previously found mappings. When learning it, I think it would have been more obvious if I had been shown an example problem where you just recursively jam everything into a hash map with the keys being the input of the function and the values being the output of the function. Instead, I had to try to wrap my head around "optimal substructure," "loop invariants," and clever array manipulations before I could even understand what was going on. Those are important, but I think it can be overwhelming at first and makes people lose sight of what the algorithm is actually doing. All the array stuff and loops are just optimizations.
For example, coin changer II can be solved like what's below in 14 lines and only 1 is doing heavy lifting. It's by no means the fastest way to solve it, but for understanding the essential parts of dynamic programming, I think it's more straightforward. All you have to for this problem is initialize your data structures, define your base cases, define what to do if you've seen the inputs before, then define what to do if you haven't seen the inputs before and store the result into the map of seen cases.
class Solution(object):
def change(self, amount, coins):
return self.change_recursive(amount, sorted(coins), len(coins), {})
def change_recursive(self, amount, coins, coins_considered, solved):
inputs = (amount, coins_considered)
if amount == 0:
return 1
if amount < coins[0]:
return 0
if inputs in solved:
return solved[inputs]
solved[inputs] = sum(self.change_recursive(amount - coins[c], coins, c + 1, solved) for c in range(coins_considered))
return solved[inputs]
Do you have some recommendations to get a better understanding of what you are talking about? Sound quite helpful
@@JensUwe-24 The paper I was reading when I realized the broader perspective on memoization and dynamic programming was "An Introduction to Binary Decision Diagrams" by Henrik Reif Andersen. It shows off the same hash map trick. Implementing the ROBDD data structure along side that paper was an insightful experience for me because it's a bit different from the common examples used to introduce the topic of dynamic programming.
I don't really have specific resources besides that. If you want to search for some, a succinct phrase for the concept might be top-down dynamic programming with hash maps for memoization.
It's basically normal recursion, but the hash maps make repeat calls be O(1).
If you're asking about dynamic programming generally, I would first suggest a data structures and algorithms course comparable to what an undergraduate would take toward the end of their degree.
I like how my current workplace does coding interviews. They give you a project before your interview, and you work on a solution, and then present it at the interview.
This is a more realistic way to measure how good someone is at doing stuff you would be doing at work. At work you won't be solving algorithm problems from your head, you'll work on a project, and have the ability to look at documentation, look online, etc.
The problem with this approach is when they use the interviewees as free labor
@@realwermos yeah, but it has a potential reward too
So long as the scale and scope are reasonable, this is the way.
It’s cool if one or two places are doing this but if ever did that most people would only have the time to apply to 1-3 jobs a week (assuming they are currently not unemployed)
@@realwermos This is why you always license your solutions GPL3 :)
I was a math major. At the higher levels, 90% of the time is spent just banging your head against the wall for days trying to understand abstract concepts. If that doesn't prepare you to become a good programmer I don't know what would.
I have problem with abstract things can you give me some advice
I'll almost disagree. Most of my time in upper div math was spent doing proofs/derivations. Reinventing the wheel to arrive at the tool I actually want. In programming, I find myself constantly reinventing wheels and it's a big waste of time (especially when the wheel I invented wasn't as good as the one already there).
Banging your head against any problem for days will put you on path to being fired. Management wants results, not excuses. It would make you a good programmer, just a homeless one.
Programming is connected to reality. A large part of a math major is just imagining made up things. Whole other world
@@VinceOfAllTrades I think he's referring to Prime's comparison to farmers where he said that because farmers work "harder", they're more likely to be better programmers.
5:30 No its so true - why would i want to work somewhere that gatekeeps on weird recall of esoteric knowledge instead of somewhere that just wants to see me work through a few more or less "normal" engineering problems
13:35 people deal with algorithms daily. Idk what a farmer does, but I worked with people that had to move things around, construct tents or whatever, and I heard them talk about the best way to do it. It always involved their experience observing what is the fastest way to solve that problem. Be it build tents on a set area, with X amount of people, mowing the lawn with X amount of people and so on.
Prime keeps defending the status quo when asked about tech interviews when the status quo is infact in question! Yes you're going to pass an interview if you prepare for the bull shit they're going to throw at you but people are arguing that maybe there should be a better way than that.
Even if there is a better way, you still put these stupid tech interviews IN FRONT of the better way, to filter out the dumb and ill-prepared.
Bro was asked how to implement a CSS selector at google. 99% of google interviews now include leetcode hards. Not something so trivial/practical...
I'm so used to those being hard questions that at first I thought he meant "how would you implement a parser for a CSS selector and the DOM traversal for updating it if you were building a browser?"
@@BlueEyedSexyPantsI don’t do front end, what does he mean? Like straight up the process of creating a css tag and implementing its behavior?
@@brownie1035 No, I think it was literally just write it like you would in the browser, e.g. "div > *" Something so trivial that it's a joke that it was in an interview at all.
Exactly, the era now you have to be the best of the best to even get into an entry level position, its crazy
@@ttheguyy Only in U.S. because in developing nations you'll have to be sufficient to do the job and that's it! Again Economics is KING it's a DEMAND and SUPPLY issue there are too many programmers and less jobs every year! Wait it's all about DEMAND and SUPPLY..........Always has been!
One thing about kids "that just get it".
I was one of them and I barely studied for anything if at all, as a result I never really learned how to study, which was a critical skill later in HS and After HS.
I struggled, and I assume some like me did, too.
Same. Turns out I was not challenged enough in school. I never had to learn math, never. I never prepared myself for exams. Then in college I realized there are some hard math problems out there.
Yeah, what do you know, HS is a waste of time (because it's way too simple, and you're moving at the pace of the statistically slowest kid over the last 15 years that they based the curriculum over). I learned how to study in university, and even there, I didn't have to put that much work into the CS courses, it was the math and EE courses that were actually hard
I'm a very senior developer. If a company asks me to do these types of tests I will assume they are incompetent.
Every FAANG company will make you.
@@sophiophile The vast majority of programmers don't work for degenerate FAANG companies.
@@sophiophile yeah because they do not know how to interview at-scale.
Anyone else notice that in prime’s first rant kind of misunderstood his point? Pretty sure the guy in the video was trying to say that the general view around leetcode is that if you do it enough you’ll be able to solve any algorithm just like famous mathematicians.
Yeah
Yea, and this opinion is somehow echoed on cscq. Some interviewers on reddit repeatedly say, "I fail candidates who memorized the algorithm, I want to see people come up with a thought process on their own." Even though the number of candidates who can do that are very slim. What they really mean, is "candidates who bullshit me into believing it."
@@kirby145x Those interviewers are right, anyone who can't explain their reasoning for easy/medium questions is a bad programmer who just memorized algorithms and cant actually code. You don't need a PhD to explain how inverting a binary tree works.
2min and 3sec into this video and I'm yelling into the keyboard.... When I was 20 I interviewed at microsoft, did not get the got, but my answer to an interview question ended up in the code. When I was 24 I interview at Intel and was asked how much code I write in a year... at that time about 30-50K lines. The interviewer called BS and I never got the job. Years later I was converted over 2M lines of code from 18bit to 32bit for IBM in both c and assembler in less than a month. I interviewed at Amazon and asked to design a wordprocessor/texteditor at the time I was building high speed banking/payment systems.
At the end of the day I get stupid questions from interviewers who do not understand that their job is to find highly qualified people not to act as gatekeepers. If Dikstra's algorithm is on an interview question then you should leave.
Primes first speech had nothing to do with the guys point😂
Prime needs to learn to STFU sometimes. He made it 36 seconds into the video before pausing and then rambled about nothing for 5+ minutes, of course he missed the point.
Binary search is surprisingly difficult to implement. While the concept is really simple, there are 5 places where you can make off-by-one error, one place where you can get an overflow, one special case you might forget about, one check you might forget about. And there is also one way to implement it that works, but does an extra operation inside the loop that can be brought outside. Devil is in the details.
So you just import a library or call a function. If all your programmers are reinventing the wheel every time, your code is a security nightmare and impossible to maintain.
Asterisk, maybe you're a senior engineer at Intel designing a new CPU. You need your algorithms to be cycle perfect. Meanwhile, there are 100 marketing people working at all the vendors trying to sell your chips. They just need the website to display in a reasonable time. And getting it tighter relies more on things like caching than algorithm optimization. If a page takes 6 seconds to load the first time, but then gets cached for the next million views, who cares.
My dude, it's like two conditions
@@KevinJDildonik In interviews, I asked to implement "overlap(a,b,c,d)" where a and b are respectively the lower and upper bound of the first range and c and d are respectively the lower and upper bound of the second range. So, they don't even need to validate that. Yet, most programmer fail to write good code.
And there are plenty of libraries for hat, yet, if they can't write such a simple code (it's a one liner), they certainly can't think about more involved problems where you need to use two or three libraries the right way....
And to top it, in my field (Tree to tree transformation driven by trees), custom made algorithms are a daily thing.
And no, I won't be asking a dev to do something we do on the job, because I don't have 2 weeks of interview ^^
@@programaths I'm fairly sure you elaborate more in interviews about what overlap is actually supposed to do, but it's not immediately obvious here whether it's just supposed to be a range check if there is an overlap or whether it is supposed to produce an overlapping of both ranges.
In first case, I would challenge you on the ambiguous name and in both cases, it would actually be better to reduce it from 4 parameters to 2.
It's also important to note whether calls to that function can be assumed to be well-formed or not, otherwise it's definitely not a one-liner anymore and I would also tell you that if the solution is a one-liner, it's bad to have this function in the first place as it's just pointless indirection.
All the reasons why I think such interview questions, if they actually aim to get "the correct solution", are just futile.
Hard disagree that it is surprisingly difficult to implement. Off by one concerns don’t change this. In fact it’s so simple that 101 classes teach it.
I live in a barn, work on a farm, and program in my free time. Before covid, I worked with children for a living. This rant was made for me, haha. Can confirm it's all true.
When the company i work for got bought by a VC, the management consultants that took over for a while forced us to ask how a C# dictionary works internally, and solve a riddle about coloured balls.
If someone chooses to implement their own dictionary instead of using the built in, i don't want to work with that person.
Now we only do conversations in interviews and it works really well.
Prime tends to mock chat for saying "well ackshually" and finding an exception for everything, but he is doing exactly the same thing over and over again.
On top of that the meaning went over his head and he went on a tangent, that does not address to point at all.
From your point of view it is not cheating, because you are approaching it from the angle that interview is meant to check if you know certain algorithm or not, and as you said - this is not helpful.
And this is not helpful, because checking if you know it shouldn't be the intention (but sometimes it sadly is). For someone new, who is just trying to do learn to do his job, it all looks like he should be smart enough to derive this algorithm just purely with is intelligence. Not that he should learn it, because you don't need it on the actual job, just that you should be smart enough to make it yourself. And interviews are making it look like this is the case, not to check if he knows it, but if he is smart enough. This is why he called it "cheating". It is not cheating like in school for example, where you have external source of knowledge to pass the test. It is cheating because you are memorizing the algorithm, that is intended to check if you are smart enough to come up with it on your own. Do you get it now?
I don't do leetcode for interview practice, I do it to challenge myself like I do with weight lifting. Reps to failure again and again.
winners mindset
My man turned multiplication into multiplication and addition.
anyone has the link to the "city escape" array problem mentioned at 23:25?
The game being played by many interviewrs: ask a hard question, watch the regurgitation, move on to the next.
Especially for junior/entry level jobs.
"Weird Twitter takes" are how very many interviewers think theyre supposed to conduct the interview these days.
Just starting getting to your rebuttal of his first point; I think he's meaning you have to already know the answer going in, it's not really something a usual person could derive without just knowing the answer. Say the cycle detection trick, the normal first thought is to keep a list of pointers and check against that, not the turtle and rabbit race -- unless you've studied the question and knowthe answer upfront now, so equivalent to peeking to someone elses solution on an exam. Although wouldnt count that as actual cheating cause knowledge sharing is aprt of programmer culture and algos are a thing that circulate but I get what he means
17:15 "I got like 2 inches here people! It is unfair!"
Nice to know Prime.
It is so funny for people to be super enthusiastic about algorithmic shit. Yet, in real life, most enterprise programming is writing code about talking to a database and saving events for marketing. Normal everyday tasks aren't about solving traveling salesman or making the most of sorting but "how to make this box highlight on hover".
This whole shit circles back to companies separating the actual programmers from hiring (edit: and instead delegating hiring to HR), so you get bullet point questions and answers
Quicksort without in place modifications is still quicksort. The glorious concept of orthogonality strikes
I love when Prime nitpicks an argument that he didn't understood for 30 minutes straight and gets angry at chat for pointing the fact that he didn't understood the very simple premise.
That's exactly why I come here, to get angry.
some of us had shit math teachers who didn't even think to explain why things worked
9:20 That's definitely not how I would calculate 55*32!
Here is how I calculate it: (In my head! No paper required.)
55*2 = 110
3 * 55 = (2 + 1) * 55 = 110 + 55 = 165
1650
+110
=
1760
You mean 1760. "We regret to inform you that you didn't pass our first round of interviews" lol
@@jamesst8503 That's called a typo.
I just should never written it down lol
much easier way:
50 * 32 + 5 * 32 = 1600 + 160 = 1760
Math vs farmer point is absolutely true. I told a friend about TOP (He left his math degree at Oxford due to finances) and after only 4 months he was working and already extremely proficient with coding. Vs my other friends who got into coding but had unrelated experiences to problem solving, which took them years to get into it.
while im far from the worst at math & that ive come to realize that math is basically the oldest programming language (it has operators, including logical operators, sequence types, constants, algorithms & functions too)
it doesn't mean that being good at it automatically makes you a better programmer, in my experience, the illusion of "extreme proficiency" in programming is largely dictated by the tools/environment & language used, with exception to some programmers.
while they share some stuff in common, they are entirely different skill sets at the end of the day.
@@anon-fz2bo you can't deny that it helps a lot if you are good at advanced maths, though I must say being "skill hungry" is probably a much stronger indicator if you are going to be good or bad at programming
@@C4CH3Sim not sure i agree entirely with your first statement, imo its not as simple as a binary answer, its deeper than a yes or no as it depends on a multitude of factors.
but i do agree with your second statement. in any case im just glad i find math interesting & easy for the most part, same thing with programming although i love the latter much, much more 😂
Eh.. I think that's a pretty classic case of correlation not causation. I don't think anyone would argue that people who are good at math also happen to be good at coding - there's a lot of overlap in the thought processes required for those things.. but that doesn't mean the things that they learned are necessarily that meaningful - they probably would've found it rather easy to learn coding even if they didn't have a higher education in math just based on their innate talents.
@@anon-fz2bo math is the base of EVERYTHING. If you know real math (how to proof stuff, how to understand your problem and so on), you can go anywhere you want. But in engineering they only learn how to use stuff, not how to create math. That's a big common intersection between CS (with a strong basis in math btw) and math (the real one, not the one in engineering. That is practical, but not the whole thing. Engineering is like the bootcamp of math).
“Never memorize something that you can look up.”
― Albert Einstein
"Hello"
― Albert Einstein
The entirety of C++
Wish I got these la la land interviews. I’m spending more time outside of work doing leetcode rather than learning real skills
A* is the same as Dijstra's, but at each step instead of computing the raw distance you compute the raw distance and the heuristic and add them up. You explore the node with the minimum sum first and add it to the explored list.
If you have 2 nodes exactly the same, you choose an arbitrary tie breaker like LIFO or FIFO and be consistent with it.
There are 3 versions of A* and only 2 are relevant.
Version 1 works with an admissible heuristic, but doesnt care if it is non-decreasing, but can lead to loops and other weird stuff.
Version 3 works only if it is non-decreasing (and admissible. Non-decreasing or whatever it is called, implies admissibility). It involves a heap and visited list.
I may be misrembering some details, but we just had an exam over this topic a month ago.
how does prime create a 29 minute video yapping about a 6 minute video man, how does he do it!
His video script algorithm is O(n^2)
0:38 Interview Questions, Disagree with Prime
some interview questions are trivia ( Algorythm X that they dont even use in the product they intend you to be working on)
designed to destroy your confindence when it comes to asking for salary
10:26 The Intersection. Agree with Prime, its not true
An non-farmer mathematician will most likely fail to get a good yield while a non-math farmer will most likely fail to solve laplace poison equation.
That doesnt mean they dont understand algo thinking.
They each have their own unique way to approach a problem and break it down in smaller pieces and then handle them 1by1.
For intersection with IT Software. IT Software is not creating specs, it implements them.
An Agriculture App will be better with input from Farmers, while a Math app will be better with input Mathematicians.
Also, please stop saying IT is MATH, just because it is not.
Just search "How Computers Calculate" and see that, in itself, MATH is an implementation, not a built-in feature.
"...destroy your confindence when it comes to asking for salary"
Huh...that... that is great insight....
@@RaveYoda Maybe I didnt express myself right so let me rephrase it.
The way I see it, the interview is meant to uncover which skills you are lacking or not proficient in relation to the position you apply for.
Every single one that you don't fulfil or partly fulfill will diminish your negotiaton power. Therfore when you reach the interview question, "What are you're salary expectations ?", depending on the answer, they can low-ball you for each and every one, as well as what you have written in your CV.
Some companies would go as far as offeringe the minimum wage when you check 9/10, taking advantage of the fact that you are a junior with no work experience.
And they wonder why juniors leave once they get work experience.
13:43 you can’t separate confounding factors like how to use a keyboard a computer concepts like copy paste web browsing opening files etc
DFS > BFS, I'm ready for my new career.
Lol that 10 minute tangent in the middle started at mathematician over farmers and got so far into the abstract
My degree was in Information Systems with management and accounting subjects. We didn't have a single algorithm subject. didn't need it cause the degree was focused on getting you ready for a corporate IT/Software job. Only math I learned was in the accounting subjects. And I've never felt like it negatively impacted my work. because my degree taught me stuff that is actually useful in a real job, not just in the lab.
I wish they asked these kind of questions: Can you build us a scalable, bug free, good looking, performant frontend with React? To which I would say yes and that it would take me about a month to have a working prototype, then I would deliver, because that's where my skill lies and then I would be hired. But it does not work this way for some reason.
Prime doesn’t like it when people preface too much or give a hot take expecting people to understand the nuance 😂
I also freaked out when Neetcode didn't write the 1 on top when carrying it out to the neighbor lol
I derived the 2 heap running median solution on the spot for a DRW interview in 2017 and didn't get the job. Sure, that was an impressive problem solving feat by me, but the signal gets clouded by other interviewees who are over-prepared. Being smart won't get you to the head of the Leetcode queue unless you're O(n!) smart or you do the prep(*cheating*). And don't invalidate Neetcode's point cause you define cheating a little differently my guy.
The issue with leetcode problems is there are so many that are total bs that it’s hard to filter out which problems are reasonable and which are some stupid ass bit manipulation or dynamic programming trick. I work on a problem only to find out the solution was some gimmick crap thing
yeah, this happened with me, took me a whole day to realize I was not gonna solve the convex hull problem, did lots of brainstorming, still didn't get anywhere, at last I just had to look at the solution and it was like the gimmick crap thing that you just mentioned.
All search algorithms like Uniform (aka dijkstra), A*, DFS, and BFS are actually the same algorithm, except for the container that you are using to keep track of open/not explored nodes.
Uniform search has a priority queue, and the priority is given by cost to current node + cost to the adjacent ones.
BFS just throws all nodes in a fifo queue.
DFS just throws all nodes to a stack.
A* modifies uniform search with a heuristic to change the priority in the queue.
Bro just fckin listen first bruh aint let him speak for 10 secs and already started yapping
1:37 "No that's not cheated. That is literally the opposite of not cheating"
Well, I watched 20 minutes of this, and I still have no idea what's their opinions on LeetCode. Probably it's not important at all, because the original video starts with some take on school level math, and the reaction video goes into lengthy discussions about intellect.
Summarize: you should not try to memorize leetcode problems to past the interview, instead use it to practice the core concepts of programming. It’s the correct goal of leetcode. Thats is what i got.
Btw, farmer will surpass mathematic people in a long run
I crammed this multiplication algorithm from childhood up until late middle school, after learning about factorisation I did something similar and understood why this worked, that day I understood schools are not teaching things that they should be teaching.
That they should teach algebra concepts to 3rd graders? I'm not sure how you get past just memorizing the process for them.
@@briankarcher8338 I don't get how you concluded "teach algebra to 3rd graders". I don't know about other countries' education systems but in India it's pretty bad, most of the schools/teachers just teach you to cram formulas. I had had great teachers, one of my teachers taught high school mathematics (calculus) like it was literature, they created a story around it, how it was developed, why we use it, where to use it, he even derived certain formulas, I really liked this type of teaching.
There's not just one answer to A*. You can speed it up significantly by side-caring the node lookup inside the main algo. I derived that solution when I was working with huge maps of geological data, but it turns out it was already published in a Graphics Gems book. You can also do post-processing to clean up the path by using line of sight for arial vehicles and traversal checks for land based vehicles that have a gradient limit. For every point, you see how far you can get down the line going straight to it and then chop out everything in between.
The thing with the farmers vs mathematicians comparison is that I don't think being a farmer has any notable correlation with programming related skills.
I didn't research anything, but my impression is that farmers usually become farmers through heritage, and if that's true, then it means that their skills affinities are not predictable well with their job, since for most technical jobs, people only apply if they had enough affinity and curiosity to spend enough time with, otherwise they'd just go do something else they like better. Of course this is not always true, but it is somewhat of a tendency.
So that said, I'd assume farmers to have approximately the same average affinity to programming as the average living person, with the additional hard working ethic.
At the same time I'd assume that mathematicians on average have higher affinity compared to the average living person.
I don't think the "hard work" could overcome the affinity here, because affinity somewhat correlates with enjoyment, which results in less effort when "learning", while also requiring less time due to said affinity.
That said, while I don't think farmers on average would overcome mathematicians in programming skill under any time frame, I do think that farmers would probably be a more desirable candidate for a programming job, because you don't need everyone to be a great programmer in a team. Having a few great ones, providing the general path and some okay, but very deligent ones probably yields a higher work efficiency over all (which is partially why companies hire non-senior level people at all, not all work is extremely complicated, sometimes it's just annoying and long)
btw The fastes way to multiply 55*32 is to shift it left by 5 times because 32 is binary value 100000 which is 1 (0b1) shifted 5 time to be 32 =0b100000;
Same way like multiplying by 10 in decimal system means sign zero to the value so in binary world, multiplying by 2 means to sign 0 at the end to the value;
mov eax,55
shl eax,5
now eax holds result: 0b11011100000 or 0x6e0 or as you wish decimal 1760
shl eax,5
0b110111
The most senior dev I've ever known has never done a coding quiz when interviewing prospective employees and thinks they are stupid.
Inverse trig substitution is mostly a contrived thing. Its only really for nice polynomials.
And by nice I mean second order... like you can't solve a 3rd let alone 5th order polynomials with it
0:39 I interviewed with Amazon (back when they flew you out to WA for it), and the dude wanted me to implement an LRU cache from scratch. He made sure I didn't know what it was beforehand. When I got home, I looked it up and discovered that it was indeed one of those algorithms written as a thesis by a genius.
Gimme a break. Even the genius who wrote the algorithm couldn't come up with that in a 50 min interview.
Fellow DSA specialists, which language is best to learn/use for DSA stuff? Does it matter at all or would it make sense to use something like C over Python due the large amount of helper functions built into Python? Or is it something you can still use Python for, but everything you do is from scratch? (Please don't bash me for my lack of knowledge in the area, I just wanna level up.)
Edit: BTW I'm gonna check out neetcode and leetcode and get more familiar with the stuff in the meantime but feel free to reply and leave suggestions
Python is the default for solving the leetcode questions.
@@plaidchuck surely there’s a lot of questions though where using python would be less than ideal though because of how long it takes to right?
want to test the coding interview?
- implement the BigDecimal
- create datepicker with only pure html javascript css + copy paste text
- create a decimal textbox that user type only number but show delimiter as preferences + copy pasted value
I think farmers who have gone to college in the past have made some of the best engineers and likely also programmers. Not one myself, but have known some farmer and farmer-adjacent folks who can build a car from scrap materials as a side project, definitely think it's a good idea to get your kids into hands on tooling if you can.
I got a question that took a 2 hour long graduate cryptography lecture to explain and is a backgracking hard that is leetcode #2000-something. Some interviews really are stupidly difficult. I got another really tricky priority queue question recently that was a medium to a hard 2 weeks back.
Damn the hand motion reminded me of Schitt's creek before you even said it. What a great show
Here's how I memorize Dijkstra and A*.
BFS is a special case of Dijkstra when the weights of all the edges are the same.
Dijkstra is a special case of A* when the heuristic function (I like to call it the penalty function) always returns 0.
Since I'm comfortable with BFS, I can improvise Dijkstra and A* when I need them.
That's a good way to look at it
lol, we literally asked at a few companies the fizz-buzz and most people have no idea how to even start, you are supposed to figure it out :D
One time I had a group interview and the interviewer literally pulled out a bunch of play-doh, handed everyone a container, and said "okay you got 5 minutes to make whatever you feel like making then explain why you made it." It was a valet job parking cars at a hotel.... stupidest interview I've ever attended.
I WAS a math superstar in grade school, I fixed cars and worked in motorsport. Which IS a lot of numbers, but I still forgot almost everything long before I decided to study CS. It's always hilarious to me when math shortcuts is strongly associated with problem solving (it is obviously), but a LOT of math gooners don't have other critical thinking skills.
Like you can measure one of those block puzzle tests and figure out your inverses, but flipping them around and eyeballing the boundary will get you to the solution faster if you systematically flip things that look like they'll fit. Which is technically ratios like poker, but you're not actually doing math.
The way I was raised is that being a "master of none" is generally better. Same thing with memorization, just be able to GET the information you need without having to research.
Ppl can't do a bubble sort! Out of 1.5b ppl, I 🎉 when I interview someone that can tell me at least bubble sort!
Like bubble sort specifically, or not even selection sort or insertion sort? Even out of the quadratic sorting algorithms, bubble sort is the least useful one. Unless you expect them to be teachers, sort data stored on tape drives, or do arcane graphics optimisations, there's no reason for them to have even its basic principle memorised.
There is variation in cognitive abilities among individuals, but also among races. Or do you think we can differ in skin color and bone structure, but the brain is the same?
bruh rural America looks down on the "coastal elite" all the time
Farming was the worst example it requires constant problem solving. As a developer + farmer there are so many parallels between farm management and software development
yea people forget that the progressive scan television was invented by a farmer. the only dumb thing about a farmer is them being willing.to accept what is ludicrously low pay given the amount of work involved
I constantly feel insecure about my programming abilities but having prime say dynamic programming is hard made me feel a little better cause I actually feel confident with that and coin change
Memory works best in a linear fashion. Each thing can lead to another. We dpn't know how the neurons work on a fundamental level, but it probably has more to do with order. We literally have spatial memory. It's 3D.
19:54
some people can talk to the screen and not watch video for longer periods of time than others
5:50 That rant is legendary
7:40 to be fair that's how I've always done 2 or 3 digit multiplication in my head
I actually did derive Dijkstra's algorithm on my own (albeit: when applied to a tiled grid, at least, which is a more obvious/limited use case), I was just working on a maze-game for a final project in highschool and it seemed intuitive to me when I was checking that each maze had a valid solution that wasn't too short - I needed to measure the optimal solution's distance. Only realized it was some special algorithm that people are taught several years later when I was in Uni. Thankfully though that question is still a gimme for me in interviews, ahaha.
I agree very much though with Prime's first counterpoint at the very beginning. And I generally agree that memorization of googleable issues is an awful way to measure a candidate's quality.
no you didn't
You most certainly didn't do it by yourself sitting in timed coding interview under pressure
@@mechano6505 of course not - not originally. I took like a week of working on it while building a maze game.
@@Night_Hawk_475 That's the point though, what Neetcode was saying is that you're not going to derive these algorithms during an interview, you just need to know it.
Just got done with data structures class, and while completely eye opening, and using leet code to see how things work, or dutch national flag problem. Find interesting ones, break em down, add to the original leet code problem, and move on. Theres so much to learn, and you should have a solid foundation in algorithms, dont think interviews are just algos. Its a part of it, but not more of a check system rather than the mega defining factor.
As a farmer/programmer I can agree that mathematicians would have an advantage in learning programming but after I understood problem solving it was like opening the floodgates. Very rewarding to learn.
Sorry, Citadel OA's alone are precisely full of these terrible questions.
yeah I'm from such a location. When I went to uni they classified me and my friends as "can't possibly finish uni" and we were second hand students in any lab or class room from day 1.
There’s actually two versions of quick sort depending on which partitioning strategy you use…but the point stands.
Refusing a job offer from google is a nice flex lol
Came for programming advice, stayed for the parenting advice. Good stuff. Great video
The math (pure maths) background it's really useful because you have to memorize and practice a lot buuut at the same time learning how to do proofs, and how proofs works. I remember trying to memorize proofs on my first year and on my second year I was already reverse engineering proof results to arrange the proofs. Why do the author of the book chose epsilon to be less than (b-a)/2*arctan(mass of the sun)? It's not magic it's a process that you have to do aswell to understand how everything works, and that's learning at its peak
I loved English because their is a definite answer depending on what they say to use to get the answer. It also makes my adhd brain happy as each step along the way I get satisfaction. I found English lit hard due to the fact that yes their is kinda a right answer but it’s all about how you explain it and it’s built on abstract ideas that my younger brain couldn’t compute at the time. Also writing didn’t give my adhd brain what it wanted and actually felt like a chore. I have more of a logical brain than a creative brain due to me having Aphantasia and I always felt that I couldn’t visualise what was being said in say a book to extrapolate the meaning. Whereas with numbers they are a set thing that I learned and felt comfortable doing. I think that’s now why I love code so much. I get adhd happy Chems and can be a little creative whilst still being very logical.
I've been wondering about this.
Is it better to solve the problem yourself or is it better to learn the way it is solved
Chicken or the egg
Always bet on the farmers! I was teaching a few courses at a local university for the Agricultural Mechanization program and their learning speed for PLC programming and electrical circuits was impressive. We were able to go into much more advanced topics over the required core.
Google interview 12 years ago?
Well there’s your problem.
These days it’s just leetcode hards man. It’s not let’s have a conversation about walking a tree.
I think Neetcode refers to leetcode questions where the bar has been raised so high that interviewers start seeing the more complex solution like in "Top K Frequent Elements" where the logical answer is you use a heap and return k elements, or use bucket sort but then there's people that know the Hoare's sort and I'm not learning that by memory (now). When I have to remember so many other important patterns first.
Also, I believe people cheat mostly in OA's I believe that's where Neetcode refers to cheating. In an in-person interview you can't cheat. You memorized? Sweet, that's advantage to you and good for you. But I can see what Neetcode says where the initial screening interview I had to solve some medium to hard leetcode questions. I won't complain, it is what it is, I'll just practice more, but it is definitely getting harder.
No one taught me data structures and algorithms in school or work. That’s why I ask people where do I learn how to learn things the way leetcode and advent expect people to have learned how to learn?
Everyone just learned basic Algebra.
You were particularly unhinged on that stream 😂😂
9:15 you in 'merica really write trailing zeroes before answer?
I agree with 95% of this .. until the point where you say that dsa is 'not easy' and that's why it's paid so well. I tend to believe it is easy and I don't think this industry is 'paid well'. This is something that everyone likes to say but in my experience I have friends who make a lot more money than I do as an engineer.
I remember an take home interview I had, the guy said from your cv you don't know rust but you seem smart, we use rust so you gotta do the assignment in rust. Here is 24 hours do it and we will examine the code. Was so fun trying to figure out how to write rust with a python background. Then got rejected on the grounds of terrible code lmao