[HN Gopher] A guide to learning algorithms through LeetCode ___________________________________________________________________ A guide to learning algorithms through LeetCode Author : VitalyAnkh Score : 253 points Date : 2020-08-15 09:11 UTC (1 days ago) (HTM) web link (github.com) (TXT) w3m dump (github.com) | bradlys wrote: | Gosh, I don't enjoy that there is so much competition in this | space. I can't compete against people who essentially seem to | have no life or other interests than getting job at Big N (or | enjoy competitive programming). | | It feels like this culture has ramped up in the last 5-10 years. | When I started interviewing, the questions were easier. It feels | like they've gotten more difficult - or at least the answer the | interviewer wants is less attainable. | | And I feel like I know why - go look at the leetcode discussion | forums. There's almost always some post at the top saying, "I did | 1000 problems and won't stop. I got accepted/rejected and learned | so much. Believe." From the outside and inside, it looks like a | cult. I feel like these folks are just making it worse for | everyone. | | Maybe I am just bitter because I've passed every mock interview | I've done but I can't get an offer from Big N still. Startups are | the worst as a non-founder/non-executive. | [deleted] | PragmaticPulp wrote: | > I can't compete against people who essentially seem to have | no life or other interests than getting job at Big N (or enjoy | competitive programming). | | Interview prep doesn't need to be a grind. One of the nice | things about Leetcode is that the problems are bite-sized. You | can do one or two per day on your lunch break and make a lot of | progress in a matter of months, or even weeks. | | Don't approach it like a cram session before your interviews. | That doesn't work unless maybe you're a new college grad with | no other obligations. | | > go look at the leetcode discussion forums. There's almost | always some post at the top saying, "I did 1000 problems and | won't stop. | | Obviously the Leetcode forums are going to be a hotbed of | discussion about Leetcode. You have to keep in mind that many | of those people are entry-level developers treating this as an | extension of their education. For them, it's basically a | miracle that a mostly-free website lets them practice for | interviews for $200K-300K+ career paths from the comfort of | their web browser. Compare that to just about any other high- | paying industry, where getting the right education, | credentials, certifications, and test results will take years | of your life and potentially hundreds of thousands of dollars | of post-secondary education. We really have the easy end of | this deal. | | Don't let the total number of Leetcode questions overwhelm or | discourage you. It shouldn't be approached as a cram session | before the interview. It should be approached as a consistent | habit or practice over a longer period of time. | | If you just don't want to do any Leetcode or whiteboard | interviews, that's fine too! There are plenty of jobs out there | that won't require any of that. | | However, you can't have it both ways: Big N salaries come with | a high barrier to entry. All things considered, spending 50-100 | hours of your free time solving problems on a free website at | your leisure is really a small price to pay. | bradlys wrote: | > All things considered, spending 50-100 hours of your free | time solving problems on a free website at your leisure is | really a small price to pay. | | The problem is - it's not 50-100 hours for most candidates to | pass. I've done well past 400 hours of interview prep and | never received an offer from Big N. I tried the consistent | 1-hour or so a day for months thing - it isn't guaranteed | either. Want to emphasize this point to - it isn't like I | can't do the problems. I've solved most any problem I'm given | - it's that it just doesn't fucking matter. Whatever bias the | person has is what they will evaluate on - the problem | solving is merely a formality. | PragmaticPulp wrote: | No one is guaranteed a job at Big-N companies. | | It's important to understand that Big-N job offers or | rejections aren't a perfect indicator of a person's | programming ability. | | The interview process isn't perfect. It's not designed to | be perfect, because that's an impossible goal. In reality, | Big-N companies have so many applicants that some of them | have higher rejection rates than Ivy League universities. | | At this scale, the goal isn't to admit any and every | qualified candidate. The goal is to select for the best of | the best and minimize false positives, even if it results | in a large number of false negatives. | nulptr wrote: | I don't think it's just about solving the problem. | | It's also about: - how you convinced yourself and the | interviewer that your solution was correct (essentially an | informal proof of your code) - how you test | your code after you finish coding - what | clarifying questions you asked to tease out a concrete | question - what edge cases you thought of and | how you handled them - how you handle bugs if | they appear in the code - what solutions you | presented and what their tradeoffs were, and why you | decided to use a particular solution - whether | your code was idiomatic - whether you used clean | abstractions - maybe also comments and variable | naming | | ... and probably others I'm missing. | | I don't deny that interviewers have their biases, but I | would hope that your interview performance is the major | factor in whether you received an offer. There are plenty | of people at Google and Facebook who haven't majored in CS | at a top school. | noema wrote: | From talking to some people who give out these | interviews, most of those points really don't matter at | all. What matters is A) getting a correct solution and B) | being able to explain how you arrived at the solution. | Tests, idiomatic code, clean design, etc are not expected | and will inevitably waste precious time. Besides, the | very nature of the interview (using a walled-off in- | browser pseudo-IDE) restricts you from actually writing | best-practice code. | doc_gunthrop wrote: | All the items are taken from Leetcode problems, but for the vast | majority of them the author (labuladong) does not give | attribution. | | There should at least be a link to the related Leetcode problem | for each section. | pcestrada wrote: | Can you imagine having to learn all this just to make a | connection to a database, process some data, and then persist it | somewhere? | PragmaticPulp wrote: | The popular sentiment on computer science knowledge has done a | complete 180 in the past several years. | | Not that long ago, it was popular to complain that junior SWEs | didn't really understand the algorithms, the data structures, | and what was going on behind the scenes. The complaint was that | they were just copy and pasting from internet searches until | things sort of worked on their machine, but they couldn't | recognize when an O(n^2) solution was going to work on their | local n=10 test set but bring down the main website. | | Now that knowledge of CS fundamentals has become valued in | interviews, the pendulum has swung the opposite way. We have | more free resources than ever before to practice and study CS | fundamentals, algorithmic challenges, and even practice your | interview skills. It's never been easier for a junior SWE to | sit down, put in the effort, and work their way into a | $200-300K job with sufficient dedication. Yet people never tire | of complaining about Leetcode or having to understand CS | fundamentals online. | | Personally, I've never met anyone who was good at Leetcode yet | produced bad code in production. I'm sure there's someone out | there who knows a guy who knows a guy who can somehow ace | Leetcode but can't write an efficient website backend, but it's | not the norm. | lawn wrote: | > Personally, I've never met anyone who was good at Leetcode | yet produced bad code in production. | | I competed with this guy in competitive programming | competitions and while he was fantastic at it, he wrote the | worst code I've ever seen. | | I've also worked with many people who've never even heard of | Leetcode or similar and they were fantastic developers. | | In my opinion there's no correlation here and it's purely a | distraction. | bcrosby95 wrote: | > Personally, I've never met anyone who was good at Leetcode | yet produced bad code in production. I'm sure there's someone | out there who knows a guy who knows a guy who can somehow ace | Leetcode but can't write an efficient website backend, but | it's not the norm. | | Weird. Ability to leetcode doesn't mean you know what is | happening in e.g. an RDBMS. We've had people good at leetcode | write a single query to delete hundreds of millions of | records in a table with billions of records that was being | constantly updated by the live website. Needless to say it | didn't go over well. Ability to leetcode doesn't give you any | knowledge that doing so might be a bad idea. | xfer wrote: | You can learn how to use some function to call into a | database and study its behaviour, if you can grind leetcode | and solve problems. | | It's a good enough filter, the alternative is either way | more costly or way worse(if you have seen "interviewing" | which are just thinly veiled nepotism). | anon349852034 wrote: | > Personally, I've never met anyone who was good at Leetcode | yet produced bad code in production. | | It's all anecdotal evidence. I've worked with some brilliant | people at most places I've been and I can't think of 1 person | who even had LeetCode account. Producing great production | code is more about experience and knowledge of the domain | than knowing how to bang out algorithms. | [deleted] | PragmaticPulp wrote: | > I've worked with some brilliant people at most places | I've been and I can't think of 1 person who even had | LeetCode account. | | That's not the point, though. No one said that Leetcode is | mandatory for being a good programmer. | | The point is that Leetcode, however imperfect, is still a | usable signal for programming ability. | | Those excellent programmers you know would likely not have | much difficulty with Leetcode style problems if they were | to try them. That's the point. | yodsanklai wrote: | > I'm sure there's someone out there who knows a guy who | knows a guy who can somehow ace Leetcode but can't write an | efficient website backend | | I don't see what makes you think a person who can ace | Leetcode should be able to write an "efficient website | backend". These are different sets of skills. You can ace | Leetcode and not even know what a backend is. | | > knowledge of CS fundamentals | | Leetcode is not CS fundamentals. It's a small part of CS | fundamentals. Besides, candidates aren't asked to show they | know the CS fundamentals. They are asked to show that they | spent more time practicing leetcode than the other guys. | dbuser99 wrote: | Leetcode is not a good indicator of quality code by any | means. It's basically a filter. If one can't solve these | programming questions, there is a higher chance that they are | not good at programming compared to one who can. | tourist_on_road wrote: | But it might come handy when implementing - route optimization | problems - Building database query optimization engine | | You can argue that not everyone is implementing these from | scratch every day. But it could be argued that given an | opportunity, an engineer should have the skills and ability to | build these systems. | jkachmar wrote: | Bullshit. | | It has been my personal experience, and the experience of | many people I've spoken with, that this kind of trivia is | learned in order to get a job and then forgotten immediately | afterwards because it's useless. | | Anecdotal example: a former colleague is an incredibly | talented systems programmer and has had to study leetcode | garbage for the last few months in order to feel qualified to | interview for a position with a team that he had previously | been on at an older employer. | | As another commenter said elsewhere, these types of questions | are used because they're legal proxies for "IQ tests", and | because they filter for people who are willing to sacrifice | much of their personal time for the sake of the company. | biztos wrote: | I don't think the knowledge is _useless_ as much as it 's | properly abstracted away into core libraries for 99.999% of | the real-world use-cases. | | Maybe the questions started as "IQ tests" (or a proxy for | "fresh out of a Stanford-like CS Program?") but my | impression is that now it's a mild (or not) proxy for | hazing. | | "I suffered through this crap and by God you are going to | suffer through it to, or you can't join my little club, and | by the way I just make a hundred dollars telling you that." | | Edit: clarity & speling | jkachmar wrote: | I think knowledge of the concepts is very useful, but | precise recall of the algorithmic implementations is | absolutely useless. | | It's very different for someone to have a solid grasp of, | say, cache-aware programming techniques, algorithms and | data structures that are necessary for low-latency | architectural work, etc. | | ...but I'm aware of very few positions (if any???) that | require the ability to arbitrarily synthesize that | information on the spot. | | EDIT: Originally meant to lead with the fact that I | broadly agree with what you're saying, I just wanted to | clarify my original objection. | [deleted] | bcrosby95 wrote: | > But it could be argued that given an opportunity, an | engineer should have the skills and ability to build these | systems. | | Having the skills and ability to build these systems doesn't | mean you can regurgitate all the algorithms required to build | them on a whiteboard in 30-60 minutes. It means you have to | ability to search for algorithms and apply them to your | problem at hand over the course of several days, weeks, or | even months. | | Do you really think anyone building these systems spent only | 60 minutes both deciding upon, and coding ANY of their | algorithms and called it a day because they obviously chose | the best one? | tourist_on_road wrote: | Isn't it what computer science is all about. You won't | necessarily see the exact problem. But having the ability | to reduce the problem at hand to an efficient algorithm | that you might have "regurgitated". | [deleted] | person_of_color wrote: | Is this evidence of the 996 culture? | mjburgess wrote: | 996 is a universal culture. | | People who wish to master a skill on their own time are simply | pursuing an intrinsic (/identity-based) goal: here, excellence | in computer science. | flak48 wrote: | Evidence of Leetcode culture more than anything | throwaway_pdp09 wrote: | FYI https://en.wikipedia.org/wiki/996_working_hour_system | | "The 996 working hour system is a work schedule commonly | practiced by some companies in the People's Republic of China. | It derives its name from its requirement that employees work | from 9:00 am to 9:00 pm, 6 days per week" | cheez wrote: | Looks more like tech interview culture. | digianarchist wrote: | It's becoming obvious to me that my time is better spent learning | to solve these riddles rather than actually becoming a better | developer. I have a job search coming up at the end of the year | and whilst I've managed to largely avoid companies that ask this | type of question, I believe it's seriously constraining my | career. | | I can't speak for everyone but the whiteboard interview has | prevented me from leaving jobs earlier, moving jobs more | frequently and left me avoiding certain companies altogether. | anon349852034 wrote: | I have 2 friends who work at the Amazon office in Denver. Both | work on boring projects utilizing internal tools Amazon built | over the years and completely hate their lives. But the salary | and stock options make them stick around. You can look at this | as "Omg, this is total shit. I'd never want to work here." or | "I don't mind suffering 4 years to get fully vested, get the | fuck out of dodge and enjoy retirement a little earlier than | others." Both of my friends picked the latter. | lowiqengineer wrote: | I'm gonna take a wild guess and say that if it was Google | they wouldn't have that opinion, eh? | grumple wrote: | I wonder if that isn't the point, to increase developer | retention and reduce competition for devs. | fractionalhare wrote: | That could be part of it, but I don't think it's the primary | reason. Rather I believe it's just one example of a more | general, emergent phenomenon in capitalism, in which the top | decile of jobs in high paying careers converge to interview | methods which are a legal proxy for IQ testing. | | It is a game of cat and mouse between candidates and | companies. The candidates want high pay and interesting work, | and the companies want only the top n% of candidates for | their work, for some metric of their choosing. However many | candidates a company has to choose from, they will devise | some way of choosing the best among them. The methods for | determining the best become (in my opinion) increasingly | pathological as the surplus of candidates increases. In tech, | the result is that the past decade has seen a supermajority | of the most lucrative, mainstream jobs moving to a local | maximum: whiteboard interviews based on data structures and | algorithms. In response, candidates have gamified the process | of studying for these metrics using Leetcode, and so a | cottage industry of adult test prep was born. | | Other industries use extreme credentialism or other methods | to cut down on the vast majority of resumes they see, and | there likewise emerges a cottage industry of professional | preparation to break into these careers at the highest level. | The companies use these methods because they see an absolute | glut of candidates and become risk averse to bad hires - | because after all, if they can attract so much talent with | high pay and prestige, why should they suffer possible duds? | This is how we end up with the, "Google is okay with passing | on false negatives but can't tolerate a false positive in | their hiring process" reasoning. | lowiqengineer wrote: | It's funny/depressing to think all of my depression stems | from not being able to do these problems fluently. | rightbyte wrote: | It would be a "tragedy of the commons"-like effect for | companies that don't adhere. I would guess that is just an | unintended effect and that there is no master plan behind | making recruiting expensive, slow and inaccurate. | jdietrich wrote: | Or it's part of an organised cartel between the major SV | employers to reduce salary competition and employee | turnover. | | https://en.wikipedia.org/wiki/High- | Tech_Employee_Antitrust_L... | an_opabinia wrote: | Surely the generous pay is the biggest factor for retention? | | Competition is ill defined in the labor market because people | aren't fungible. So it's hard to really point to hard | evidence, so and so practice leads to so and so change in | salaries or increase in retention. | | Aside, nobody said this guy was looking for a low paying job. | High paying ones want leetcode. | | Google will pay a higher salary to a 21 year old than a Miami | firm will pay to someone with 10 years of experience. Nobody | will ask you these puzzles outside of ~5 markets in the US. | They also pay way less. | benrbray wrote: | Anecdotally I would say job satisfaction is at least as | important a factor in retention, at least until employees | are old enough to have started a family. | | Many young people (age 20-30) I know are in a situation | where they are paid large sums of money ($100k-$200k) for | extremely dull work. I've seen most of my friends from | college quit their FAANG job in search of something more | fulfilling, often at a 50% or more pay cut. | cactus2093 wrote: | Kind of a meta point, but why do you call it the whiteboard | interview? I think that was more popular 5 to 10 years ago, | actually writing code or pseudocode on a whiteboard. In my | experience the leetcode style questions most companies use | today have you actually write and execute code in a sandbox | environment. | | It may be that the algorithms you're required to come up with | are still overkill in that they're things you would not | normally need to write from scratch on the spot without being | able to references any resources in your day to day work. But | as far as the format goes, this style of actually writing and | executing code is clearly an improvement on the write-code-on- | whiteboard style of interview. | | I feel your pain though, the weeks of study that almost any | good engineer needs to put into preparing for interviews can be | pretty grueling. | mettamage wrote: | According to the believers it is an unbiased way of predicting | whether people are capable for the job. Google has done a lot | of tests and these style of interviews predict job performance | best [1]. | | Assuming this is true then to me it means that universities and | work experience are too heterogeneous as a measure of job | performance. | | In my experience that is true. Not sure how well the argument | holds up if everyone is simply going to study algorithms | though. | | [1] clement mihailescu says it on his YT channel somewhere in a | vid. | username90 wrote: | If you work at google you can go find those studies yourself, | they are public internally. At least you could when I worked | there. | logicslave12 wrote: | I was working on a "startup"/kinda just unemployed for two | years. I studied leetcode hard, and got hired into a 300k a | year job at FAANG. I know nothing about testing, git, software | process, roll outs, dev ops, etc. I barely know how to do | software engineering. What an idiotic hiring process. | [deleted] | sukilot wrote: | Do you think it's unlikely for you to learn those skills | quickly? People who have all those skills earn over $300K at | those companies. | wdb wrote: | My experience of FAANG interviews outside the US is that | the salaries they offer are really disappointing compared | to the US. Other industries like finance were a better deal | compared those companies. If I can get paid PS90-110k in | the City why bother working for Facebook were they were | offering less than PS90k? Note, I don't consider bonuses or | equity to part of salary. | andreilys wrote: | " Note, I don't consider bonuses or equity to part of | salary." | | Depending on the company and how much the stock | appreciates this can easily be +50% of your total take | home so I'm not sure why you'd discount it. | thewarrior wrote: | Why would equity or bonuses not be part of the salary ? | You are almost certain to receive it and the stocks | perform quite well on average. | | They still pay better than finance all things taken | together or am I wrong ? | qppo wrote: | > Note, I don't consider bonuses or equity to part of | salary. | | Tell that to the tax man | biztos wrote: | To be fair, a lot of people who have none of those skills | also earn well over $300K at those companies. Just like | grinding leetcode can get you in the door, the skills you | need for advancement are not necessarily the same ones you | need for making good software. | | I hope the parent makes the best of it and becomes good at | the craft, it will make the job a lot more enjoyable even | if it may not be the fastest way up the ladder. | kudokatz wrote: | > the skills you need for advancement are not necessarily | the same ones | | Exactly this. I suggest learning how to fabricate (or at | least exaggerate) "impact" to get promoted. It's the | fastest way to make money once you're in the door. Show | how much of a team player you are to deliver cross-team, | impactful results specifically by stepping on bodies to | get there--it'll make you rich! | logicslave12 wrote: | It's been really stressful. I know python, but not really | any other languages. I'm able to get work done. But I'm | really nearly the same as a fresh grad. But really, I was | just bumming around, then studied for four months and | destroyed their algorithms questions, so much so that | expectations for me are really high. But all I know is | leetcode, literally nothing else... | nnd wrote: | What was your prep strategy? | thewarrior wrote: | Take the same energy and apply it to learning to build | testable and understandable code. If you can go from | nothing to smoking an algo interview in months you're a | fast learner. You'll be fine. | [deleted] | TheMblabla wrote: | I think that's what these leetcode type questions are | good at. You're either naturally adept enough to do well, | or internally motivated enough to memorize/learn them. | Either way, it's a decent signal for a company that needs | someone to learn their internal, proprietary techstack | thewarrior wrote: | I partially agree but this point of view has become very | polarizing and controversial and I get the other side of | it too. People who have spent ages getting better at | their craft feel undervalued. However the two need not be | mutually exclusive. One needs to learn to do their job | while also navigating the system. That is part of the job | just like selling your work is also work. | | But having worked at both FANG and non FANG you can see | the rigor of the interview process reflected in the | quality of your colleagues. That's something that is hard | to deny having experienced it. | kudokatz wrote: | > You're either naturally adept enough to do well, or ... | | I'm personally very wary of using algorithms questions as | a proxy for how "adept" someone is at _software | engineering_. If I were running a business, I 'd | personally want to make sure people could manage | technical debt and build decoupled systems. | | I have had multiple positions at FAANG companies, and | despite being "adept" according to these algorithms | questions the systems built by these highly-paid (and, | around me, generally experienced) people are pretty awful | in terms of quality and maintenance. | | Learning a proprietary stack also hampers effectiveness | in future positions if wanting to opt-out of FAANG later | on. | thewarrior wrote: | I have observed this problem and usually it's not because | the people are incapable but that the incentives are to | ship things that move the needle to quickly get promoted. | The financial rewards at these companies from promotions | are huge. | | Where the managers have incentivized quality and | stability my team mates have moved mountains and I've | seen some really good stuff but otherwise not. | cik2e wrote: | Why do you suppose these hires aren't good at learning | engineering best practices? I see comments like yours | here all the time. Is it some kind of arrogance, perhaps | amplified by a false signal sent by getting hired off | leet code questions in the first place? | thewarrior wrote: | It's false based on what I've seen. Plenty of people | passionate about good engineering where I am. But they | are sometimes trapped in a system which doesn't always | incentivize it. | sieabahlpark wrote: | You think you're alone? | mettamage wrote: | How did you get past the resume screening? Or are you from | the US, because then it's much easier to get past the | screeming, or so it seems. | | I have yet to be invited for so much as an HR call when it | comes to FAANG (bachelor/master CS from a Dutch university). | Maybe I'm not getting past the application tracking system? | sushshshsh wrote: | Most likely you either don't have 5 years of professional | experience or they are filtering you based on | visa/citizenship status. The industry is very broken. | vechagup wrote: | Having a current employee add your resume to an ATS as a | referral is the most efficient route. Around SF at least | it's not particularly hard to find someone willing to do | that even if they hardly know you. This sort of networking | is likely harder elsewhere, but perhaps not by much. | | Simply uploading your resume to a large tech company's | website will rarely get you anywhere, is what I've heard | from recruiters. | jephir wrote: | Second this. Internal referral is the most reliable way | to get in the door in my experience. | mettamage wrote: | Ah, so that's what I've been doing wrong for 18 months. | Thanks! I'll be putting this to good use :) | logicslave12 wrote: | The recruiter just reached out to my LinkedIn profile. My | understanding is it's really easy to get the interview | PragmaticPulp wrote: | Interviews are only partially about testing your body of | experience. They're also supposed to test your aptitude and | ability to grow in the future. | | If you were capable of studying Leetcode so hard that you | mastered the interview process at one of the most selective | software companies in the world in only a few months, it's | not much of a stretch to imagine that you could apply that | same aptitude, ambition, and ability to learn quickly toward | picking up the basics of git, dev ops, and so on. | | Arguably, this is one of the benefits of Leetcode-style | interviews. They focus on core software engineering aptitude, | while not arbitrarily excluding people because they didn't | use the right VCS at their last job. | [deleted] | read_if_gay_ wrote: | > it's not much of a stretch to imagine that you could | apply that same aptitude, ambition, and ability to learn | quickly toward picking up the basics of git, dev ops, and | so on. | | But you already have your reward, right? I'm not sure how | much ambition is left after you actually get the job. | username90 wrote: | Promotions can double your salary or more from that level | so people are plenty motivated. | lowiqengineer wrote: | That's definitely not true at companies without incentive | systems. | jkcorrea wrote: | > If you were capable of studying Leetcode so hard that you | mastered the interview process at one of the most selective | software companies in the world in only a few months, it's | not much of a stretch to imagine that you could apply that | same aptitude, ambition, and ability to learn quickly | toward picking up the basics of git, dev ops, and so on. | | So by that logic, why not just create some game for | candidates to master. If all you're testing for is "how | much they want it" and how quickly they pick up on some | arbitrary system that they'll never use in their actual | job, then the subject shouldn't matter, right? | Icathian wrote: | They already have. And at the time it was being developed | and gathering momentum, some plausibility as a thin | defense of it was helpful. Why go through that process | again now when the existing system is already firmly in | place? | zerr wrote: | Err, but why do you have to prove it for every next job?... | | In reality, it's a legal way for: | | 1. Ageism - not many seniors are desperate enough or have a | free time for Competitive Programming preps. | | 2. Making switching jobs harder - for every next job one | has to prepare again, because nobody is using Competitive | Programming stuff during real work, so you forget. | | Keep in mind that CP != CS. | | And CP is not everyone's cup of tea. It is a separate | discipline/subject with its own trivia knowledge & tricks. | CP uses Computer Science the same way as e.g. Physics or | Biology use Math. | PragmaticPulp wrote: | > why do you have to prove it for every next job | | Obviously, each company can't blindly trust the | interviewing practices of everyone's previous employer. | | > Ageism - not many seniors are desperate enough or have | a free time for Competitive Programming preps. | | In my experience, senior developers don't need anywhere | near as much prep as junior developers for these | interviews. Leetcode problems are difficult when you're a | new college grad with zero years of programming | experience. They're significantly easier after you've | been programming for 10 years. | | > Making switching jobs harder - for every next job one | has to prepare again | | Companies aren't going out of their way to make it harder | to hire good employees into their own companies. | | Leetcode isn't an industry-wide conspiracy. Companies are | using it because they believe it's a good filtering | mechanism for candidates. When the Big N companies have | higher rejection rates than Ivy League universities, they | can afford to be selective. | | > Keep in mind that CP != CS. | | The problems are designed to test CS skills. | | How else would you suggest reorganizing the interviews to | test for CS skills? | jkcorrea wrote: | #2 doesn't make sense, though: If I'm company B, trying | to poach from company A, it would be in my best interest | to make the leap to applying/interviewing less difficult, | not more for employee's of company A. | | Unless you're implying a set of companies are all in | league with each other to reduce churn/competition for | talent | Swizec wrote: | That's because at FAANG those problems are already solved. | And there's a team of experts working on each of them. Maybe | multiple teams. | | Your job is to be a clever code monkey. The Process will take | care of turning your coding into engineering. | | Leetcode interviews are great at testing for just that. A | high IQ willing to solve arbitrary puzzles just because | someone said "solve this" | sushshshsh wrote: | Even at my mid tier company we have processes around the | crucial but (to me) boring parts of the software industry, | which involve building, deployment, version control, access | control, connection drivers, requirements gathering, | provisioning of resources, maintenance... | | The list goes on and on and if someone doesn't do any of | these things, the whole operation will grind to a halt. And | absolutely none of these procedures involve reversing a | linked list or traversing a binary tree inorder (maybe git | does but that's an implementation detail hidden from me | ^.^) | Swizec wrote: | Correct. And as far as I can tell, devops folks don't do | leetcode interviews. Most SREs don't either. | | At my last interview process (in June) I was being hired | into a more seasoned role where experience matters more | than code chops. There was an algorithms question but the | biggest weight was put on the "Can you design a | distributed microservice infrastructure with good | tradeoffs and solid relational modeling" | | Series A company so it's conceivable that I'll be | involved in all parts of the stack. | | If I just did well on algorithms (I didn't) and nothing | else, it would be a hard no hire. But they were very | impressed when I said "Eh for this load, you don't need | horizontal scaling except for redundancy" | username90 wrote: | But people are taught the basic boring skills required to | deliver value in a big org in the first few months and | very few fail to learn them in that time, they are by far | the easiest skills to teach in software development so it | doesn't make much sense to test it when hiring. | jorblumesea wrote: | Working at the companies that often ask these questions (FB, | Goog, Amazon, MS, Apple) work at scales that many other | companies don't. They also develop novel frameworks or work on | problems that might interest you. | | Example: if you want to work for a cloud service provider you | need to jump through these hoops, even though regurgitating | Rabin Karp or Tarjan's has little to do with day to day | engineering. | | Another example: Canonical (Ubuntu) Microsoft (windows) and | Apple (OSX) all ask these questions. If you want to have a part | in building an OS you will get asked these questions. | | Basically if you want to work at "big tech" start grinding and | don't stop until you move into management. | non-entity wrote: | I really wish I could leave the field altogether, but the | alternatives are things I hate even more or incredibly steep | paycuts. | biztos wrote: | Have you looked into being a software person in a non- | software (or only "software-enabled") company? | | You'd probably get a pay-cut vs. FAANG or whatever, but it | wouldn't exactly send you tumbling into the working class. | | I really enjoyed working on software in biotech, for example, | where I started my career... and sometimes think about | returning with all my software-company chops to see if it's | still as fun! | non-entity wrote: | I suppose it might depend on the domain / industry. Biotech | sounds like it has the potential to be interesting, but I | currently work for a large non-tech company and have worked | in government and don't like the being considered the cost | center or having to deal with the seemingly unending layers | of bureaucracy. | biztos wrote: | In biotech, at least back in the day, bureaucracy | depended on company size and nationality, and there never | seemed to be enough hackers for all the random tech stuff | that needed doing. I'm sure it's changed a whole lot | since then but as a general point, it was a lot more | diverse along any vector you like than the software | world. | | Maybe you should find a startup with no layers of | bureaucracy and no cost centers yet? This being HN, there | are plenty of them around. | yodsanklai wrote: | I spent a lot of time practicing leetcode, interviewed a bunch | of times (4 times, about 25 technical interviews) at FAANG | without getting an offer. They always tell me it was very close | (or even that I passed, but they didn't find a team in the | following month and asked me to reapply). | | What leaves me with a bitter taste is that they don't seem to | value the experience on my resume (e.g. OSS and tons of github | projects, blog or scientific articles, things written by me | they could actually check). It feels like they will favor a | candidate who can solve leetcode problems a little bit faster | to someone who is a more experienced SWE. Also the whole thing | seems pretty random. | | Also practicing leetcode feels like wasted time. It's not | uninteresting but after you solve 500 problems, it starts to | get uninspiring. There are cooler things to do for personal | development, especially when you already have a demanding job. | | But well, that's part of the game... at least the rules are | clear, and the interviewers/recruiter are usually pretty nice. | andreilys wrote: | " Also practicing leetcode feels like wasted time." | | I think take home assignments are worst in terms of wasted | time. At least your leetcode skills are transferable whereas | take homes rarely transfer. | eastbayjake wrote: | One of the big unspoken reasons these questions stick around: | they cause little imposter syndrome anxiety for the senior | engineers who need to conduct the interview. You ask a | candidate to code a toy problem, and the candidate either knows | the "trick" to solving it quickly or they don't -- very little | risk for you as the interviewer, you're just watching things | play out. | | But if your interview requires you to pair program on real code | like you'll do in your actual job, it opens up a lot of room to | look dumb in front of an interviewee. You have to handle bugs | on the fly. You have to look up (for the 5000th time in your | career) whether you should be using Array.slice or Array.splice | in this case. You go back and look at a similar implementation | in your code base for a template instead of coding from memory. | | And that's a shame because the live coding exercise is both a | better predictor of hands-on job success _and_ it 's a better | recruiting tactic: you've just had a vulnerable, collaborative | experience with someone who will actually be working with you | on a regular basis and you get a sense of whether you'd | actually like to work there. But we keep doing these algorithms | exercises because they require such little effort or | interaction from engineers who are doing this interview in | between two meetings with no prep time. | biztos wrote: | I am trying to resist cynicism, but I too am thinking that | after my upcoming sabbatical if I want to get top dollar I | should just invest in power-grinding at the leetcode gym. | | Still hoping to find a friendly startup though, since some of | the MegaCorps are lifestyle-incompatible and I'm already used | to making a lot less than Googlebucks. | PragmaticPulp wrote: | > after my upcoming sabbatical if I want to get top dollar I | should just invest in power-grinding at the leetcode gym | | Given that top dollar can mean potentially a six-figure raise | over median salaries, that doesn't exactly seem like a bad | deal. | | All things considered, Leetcode is remarkably accessible | relative to the barriers of entry in other high-paying fields | like law, medicine, certain finance careers, and so on. It's | a mostly-free website that you can work through at your | leisure from the comfort of your home, with plenty of Google | results to walk you through the questions if you run into a | problem. | | Have you spend some time on Leetcode already? I could see how | the questions could be daunting to new grads, but I didn't | find it all that painful with several years of industry | programming experience. | | Don't get discouraged by the sheer number of Leetcode | problems. You don't have to do them all to get value out of | it. The key is to do a couple per day in your free time | (lunch break, while you eat breakfast, whatever). Any | consistent practice will add up over weeks or months. | biztos wrote: | Actually I love leetcode (the website) and do it for fun | once in a while, and if I decide to go for a big grind | later on then I don't think I'll particularly mind that | part even if it doesn't get me my ticket to the Google Bus. | | The risk of cynicism is that I've been doing this for 25 | years or so and there are some things I'm quite good at | that can add a lot of value to a company, but it appears | that the highest-paying outfits will judge me on things | that are at best _very_ tangentially related to how I can | make /save them money. | | Sorry if my comment came off as anti-leetcode, I have a low | opinion of the thing so many people use it for, not the | site itself. Before hearing of my impending sabbatical I | was even planning to subscribe to the "pro" level and build | it into my work routine, just as way of differently | exercising my brain once or twice a week. | PragmaticPulp wrote: | > but it appears that the highest-paying outfits will | judge me on things that are at best very tangentially | related to how I can make/save them money. | | IMO, this is a popular misconception but it's not really | reflective of reality. | | Leetcode is ultra-popular with new college grades and | people with a few years of experience who want to break | into Big-N. As such, the vast majority of Leetcode | discussions online revolve around that demographic. | | It's true that the Big-N companies will still be heavy on | the algorithmic interview questions, but it's not true | that they'll ignore everything else on your resume. The | early 20-somethings talking about Leetcode online don't | have a long resume to point to, so Leetcode is the focus. | If you show up with a 25-year career of successes, you're | going to have a very different interview experience. | username90 wrote: | > but it appears that the highest-paying outfits will | judge me on things that are at best very tangentially | related to how I can make/save them money. | | This is very wrong, leetcode is just the baseline and | don't determine your seniority. Even the best leetcoder | in the world had to start at the lowest junior level | after college. Instead they look at your experience and | what value you can bring to determine if you become | junior, mid, senior, staff etc, so they very much value | experience not related to leetcode. However you still | have to pass the leetcode bar. | biztos wrote: | Yes, I will have to pass the leetcode bar, which has very | little to do with my actual value add. I understand | that's how it works, I have friends who hire for some of | these companies, but thanks for explaining. | | I strongly dislike having that bar, because I think it is | irrational to use it as the baseline hoop everyone has to | jump through. And honestly because it's not my strongest | suit, I'm sure I'd be less bothered if it was something | I'm good at and your average fresh CS grad is not. Which | is kinda how we ended up here I think. | lowiqengineer wrote: | How do I maintain flow? I end up extremely depressed and | disillusioned if I get stuck on a problem - that's really | what's stopped me from doing consistent prep. | TeeMassive wrote: | I'm glad that I am not alone. I've done mostly non-UI | C++/C#/Java/Python stuff, mostly business level rules and | devops and evangelizing good practices such as CI and clean | code and git (you would be surprised how many people don't even | know how what it is or how to squash and rebase). Having | studied computer engineering we did not really focus on | algorithm but more on lower level stuff and signal processing. | | I do not really fit any of the "standard" interviews. I've done | the TripleByte interview and other top 100 corporation | interviews and they all seem to assume a computer science | formation or if not than assume you are a web dev. So yeah, I | know how to implement most algorithms efficiently, I just can't | remember how to describe exactly Dijkstra's from memory or how | to balance a tree on a whiteboard under stress. I've seen them, | I learned them, but 7 years after not using them I forgot (and | frankly don't care). | wtracy wrote: | FWIW, I've found that companies outside the valley, | particularly those that don't see software as their primary | product, are more interested in work samples than puzzle | solutions. | | Try broadening your search to things like aerospace and medical | technology companies. | non-entity wrote: | > Try broadening your search to things like aerospace and | medical technology companies. | | Not sure what the correct name is, but most job listings I've | seen for these industries strongly prefer people with prior | experience in them because they have to follow strict | frameworks / processes for safety reasons. | Hackbraten wrote: | Why is the title censored? | | As a European citizen, I absolutely don't get it. Why can't we | say fuck on the internet? | VitalyAnkh wrote: | Just personal preference. I made this title by myself other | than censorship. Anyway, "fuck" sounds a little rude. | TACIXAT wrote: | This is really cool. What order are the chapters in? Seems | intense to lead with dynamic programming. | OnionBlender wrote: | I got really good at dynamic programming problems but then none | of the companies I interviewed with asked me a dynamic | programming problem. These were large tech companies and well | funded startups. Perhaps it was just luck. | jorblumesea wrote: | DP solutions were really in vogue for awhile, and seem to be | asked less now. I heard a completely unsubstantiated rumor | that FB found them to cause high false negatives because | they're such a tricky and specific problem type. Also, once | you know the "one trick" to solving them they don't help | illuminate candidate thinking. | lewapkon wrote: | Questions with DP solutions are usually not particularly | great for interviews. They usually don't have any solutions | in-between brute force and DP. If somebody doesn't come up | with a DP solution you, as an interviewer, just learned that | they don't know DP, but it doesn't give you too much useful | signal on the candidate's skills. DP is just kind of a trick | that you can learn to solve this specific type of problems, | but knowing the trick is not something that FAANG companies | want to test for. | bradlys wrote: | Partially luck and maybe you never solved it with a DP | solution. There are problems for which DP will give an answer | but it isn't a hard requirement for you to come up with it. | | I've received quite a few DP problems in my time | interviewing. | | Then again, I feel like saying I'm unusual. I've received a | lot of very difficult problems. Almost like the people are | trying to set me up for failing. ;) | OnionBlender wrote: | A good free algorithms book is http://algorithms.wtf (by Jeff | Erickson) | unemphysbro wrote: | I took his class way back in 2010. | | Challenging but fun. | tmpmov wrote: | Thanks for the write up and git book. | | Related question: I'm curious if any has game-ified algorithm | learning, sort of like those old educational math games targeting | certain grade levels. | | Might be cool to make a point and click adventure centered around | dynamic programming or greedy algorithms. | ghj wrote: | There are plenty of competitive programming sites where you can | grind rating just like you would for MMR rating in video games. | | For example CodeForces, AtCoder, TopCoder, and even LeetCode | have rated contests | tmpmov wrote: | Thanks ghj. | | I was aware of top coder/leet code, though hadn't heard of | code forces/at coder. | | For me the adventure game give a bit more concept linkage. | Take Monkey Island, I can remember how to reply to many of | the sword fighting insults, or what was needed to get pieces | of eight via the cannon at the circus. There's something to | be said for linking problems via a memorable story, giving | examples and meaning from multiple angles helps retain the | content over the dryness of problem prompt/quick solve. | paulcarroty wrote: | Found in my bookmarks: https://leetfree.com/ | | Not sure if all quizzes are original, but some of them looks | interesting. | fizixer wrote: | Can anyone explain/interpret what leetfree.com is saying here? | | > ... don't try to solve it with online judge ... | | > ... Try to learn from the solutions we provided as quickly as | possible ... | | > ... Interviewers only care about your WhiteBoard | communication skills ... | | Are they implying that rote memorization (memorize all problems | and their solutions) is the best/easiest way to do the | interviews? | | If yes, wouldn't that trip you up the moment you're asked | something new/original? | | If no, what are they saying? Is the best leetcode stuff | paywalled and they're providing a free version? | | what's the latest on step-by-step most effective way to get | ready for standard coding interviews? | | Context: I'm trying to get back into this after many years. | I've used leetcode in the past but don't remember anything | about online judge. | hackermailman wrote: | Online judge is competitive programming like | https://open.kattis.com/ or CodeWars or CodeForces meaning a | server that takes your source, compiles and runs it, tests if | you satisfied all the req of the challenge. There's books for | this https://cpbook.net/#CP4content and despite leetfree | claims of being 'useless because no online judge in | interview' there is actually 2-3 judges sitting there in the | interview performing the same function, telling you if your | code does not satisfy the problem requirements | OnionBlender wrote: | Firefox says, "Warning: Potential Security Risk Ahead" for that | website. | drenvuk wrote: | Nice how browsers have trained people to be scared if there's | not a lock. It's just an expired cert, not revoked, and | you're not entering payment information. | MaxBarraclough wrote: | There's a reason certs have a limited lifetime. People | _should_ be trained to avoid such websites. | bohemian99 wrote: | I haven't seen gitbook before, is this a common tool for | documentation? | mettamage wrote: | Occasionally you see a gitbook on HN. It is mostly for well... | books and educational content. | [deleted] | agentultra wrote: | I find this little sub-industry building up around, "the coding | interview," to be highly strange. | | Where are the papers that correlate this niche, specialized skill | to general job performance and productivity? | | I get that at certain problem domains the asymptotic complexity | becomes a baseline for performance so I'm not against testing | people's knowledge where it's appropriate. But is it really the | dominating skill? | | Reading some of the comments of people who went through the | pipeline of this cottage industry, it sounds like it's not even | useful after you get hired. In fact optimizing for it to get | through the interview sounds like a bad idea! Imagine landing the | job and having no other skills. | | I'm curious how these algo expert/monster/crushing the interview | businesses survive and perpetuate this highly competitive | environment. | hackinthebochs wrote: | >I find this little sub-industry building up around, "the | coding interview," to be highly strange. | | You should see the sub-industries around passing a board exam. | Most of us really don't understand the privilege we have | relative to other high paying professions. | PragmaticPulp wrote: | > Where are the papers that correlate this niche, specialized | skill to general job performance and productivity? | | I would love to read this research if it existed in the public | domain. However, much of this comes down to trade secrets and | business practices. It's also not very amenable to controlled | studies. | | Practically speaking, these companies have a lot at stake in | their hiring process. It's strange that so many people are | convinced that the Big N companies are shooting themselves in | the foot or otherwise making poor decisions with these | interview processes. | | Leetcode-style interviews might not have supporting research in | the public domain, but absence of evidence is not evidence of | absence. That is, just because the research doesn't exist | doesn't mean that the Leetcode interviews are bad or worse than | the alternatives. | | Even if companies did eliminate Leetcode-style interviews, they | have to replace it with some other alternative. Most of these | criticisms fail to suggest actual replacement interview | processes. | masterphilo wrote: | On your last point, the best alternative I've seen is take- | home projects where it would take less than a week to | complete. The interviewer is free to frame a problem in a way | that allows the engineer to apply their real-world experience | and show their fit for the job. It removes all the variables | around interview stress/anxiety and as a result is a better | (but not perfect) indication of their performance. | PragmaticPulp wrote: | > On your last point, the best alternative I've seen is | take-home projects where it would take less than a week to | complete. | | Ironically, take-home interviews are another contentious | topic on HN and other internet message boards. The common | complaint is that people don't want to invest much of their | personal time into interviewing for companies. | thewarrior wrote: | Anonymous google employees have claimed in HN comments that | google has data showing that these interviews do "work" | whatever that means. | | Can any of you post more info here ? | [deleted] | Gummaluri wrote: | Temporary comment for following and future retrieval of this | post. | nickx720 wrote: | This is really sweet. Thank you kind sir. | [deleted] ___________________________________________________________________ (page generated 2020-08-16 23:00 UTC)