Live data from Hacker News

Many hard LeetCode problems are easy constraint problems

buttondown.com

351–360 of 551 posts

Re: Many hard LeetCode problems are easy constraint problems

#351
post #346

Earlier quoted context omitted.

But why stop there? Why not test candidates with problems they have never seen before? Or problems similar to the problems of the organization hiring? Leetcode mostly relies on memorizing patterns with a shallow understanding but shows the candidates have a gaming ability. Does that imply quality in any way? Some people argue that willing to study for leetcode shows some virtue. I very much disagree with that.

To play the devils advocate, being able to memorize patterns and recognize which patterns apply to a given problem is extremely valuable. Tons of software dev is knowing the subset of algorithms, data structures, and architecture that apply to a similar problem and being able to adapt it.

It's funny you mention that.

That's literally what CS teaches you too. Which is what "leetcode" questions are: fundamental CS problems that you'd learn about in a computer science curriculum.

It's called "reducing" one problem to another. We had an entire semester's mandatory class spend a lot of time on reducing problems. Like figuring out how you can solve a new type of question/problem with an algorithm or two that you already know from before.

Like showing that "this is just bin packing". And there are algorithms for that, which "suck" in the CS kind of sense but there are real world algorithms that are "good enough" to be usable to get shit done.

Or showing that something "doesn't work, period" by showing that it can be reduced to the halting problem (assuming that nobody has solved that yet - oh and good luck btw. if you want to try ;) )

Re: Many hard LeetCode problems are easy constraint problems

#352
post #177

Earlier quoted context omitted.

The major difference between software devs and lawyers, surgeons, and civil engineers is that the latter three have fairly rigorous standards to pass to become a professional (bar, boards, and PE). That could exist for software too, but I'm not sure HN folks would like that alternative any better. Like if you thought memorizing leetcode questions for 2 weeks before an interview was bad, well I have some bad news. May…

You ain't interviewing your plumber or accountant come on and I have millions of other examples.

Accountants have to sit for the CPA exams (four of them), and depending on the state may have required graduate course load. And also you should interview your CPA, because a lot are not very good at whatever specific section of accounting you need (e.g. tax filing).

Plumber is probably the closest to what you're getting at. They are state licensed typically, with varying levels of requirement. But the requirement is often just like "have worked for 2-4 years as a trainee underneath a certified plumber" or whatever. That would be closest to what I'm guessing you would be recommending?

Also relevantly: the accountant and plumber jobs that are paying $300k-$500k+ are very rare. There exist programming jobs that pay what a typical plumber makes, but don't have as many arcane interview hoops to jump through.

Re: Many hard LeetCode problems are easy constraint problems

#353
post #350
post #167

Earlier quoted context omitted.

The LC interviews are like testing people how fast they can run 100m after practice, while the real job is a slow arduous never ending jog with multiple detours and stops along the way. But yeah that's the game you have to play now if you want the top $$$ at one of the SMEGMA companies. I wrote (for example) my 2D game engine from scratch (3rd party libs excluded) https://github.com/ensisoft/detonator but would not b…

> SMEGMA companies Microsoft, Google, Meta, Amazon, I'm guessing... but, what are the other two?

I prefer AGAMEMNON: Apple, Google, Amazon, Microsoft, Ebay, Meta, NVIDIA, OpenAI, Netflix

Re: Many hard LeetCode problems are easy constraint problems

#354

Earlier quoted context omitted.

Not sure if that's a typo. 5 years ago was also pretty LC-heavy. Ten years ago it was more based on Cracking the Coding Interview. So i'd guess what you're referring to is even older than that.

Talking about general jobs not FAANG adjacent.

I rarely apply for or interview at FAANG or adjacent companies...

Re: Many hard LeetCode problems are easy constraint problems

#355

My biggest problem with leetcode type questions is that you can't ask clarifying questions. My mind just doesn't work like most do, and leetcode to some extent seems to rely on people memorizing leetcode type answers. On a few, there's enough context that I can relate real understanding of the problem to, such as the coin example in the article... for others I've seen there's not enough there for me to "get" the ques…

leetcode just shows why interviews are broken. As a former senior dev (retired now, thanks to almost dying) I can tell you that the ability to write code is like 5% of the job. Every interview I've ever attended has wasted gazillions of dollars and has robbed the company of 10X that amount.

Until companies can focus on things like problem solving, brainstorming, working as a team, etc. the situation won't improve. If I am wrong, why is it that the vast majority of my senior dev and dev management career involved the things I just mentioned?

(I had to leave the field, sadly, due to disability)

Oh and HR needs to stop using software to filter. Maybe ask for ID or something, however, the filters are flagging everyone and the software is sinking the ship, with you all with it.

Re: Many hard LeetCode problems are easy constraint problems

#356
post #167

Earlier quoted context omitted.

The LC interviews are like testing people how fast they can run 100m after practice, while the real job is a slow arduous never ending jog with multiple detours and stops along the way. But yeah that's the game you have to play now if you want the top $$$ at one of the SMEGMA companies. I wrote (for example) my 2D game engine from scratch (3rd party libs excluded) https://github.com/ensisoft/detonator but would not b…

5 years ago you'd have a project like that, talk to someone at a company for like 30m-1hr about it, and then get an offer.

I read this, and intentionally did not read the replies below. You are so wrong. You can write a library, even an entirely new language from scratch, and you will still be denied employment for that library/language.

Re: Many hard LeetCode problems are easy constraint problems

#357

Earlier quoted context omitted.

There's an entire planet of jobs that have nothing to do with leetcode. I was talking about those, not FAANG stuff. Unfortunately I am not FAANG royalty. >Of course some still do, like Anthropic were you have to have a perfect score to 4 leetcode questions, automatically judged with no human contact, the worst kind of interview. Should be illegal honestly.

It might be illegal; certainly if you can show that LC is biased against a protected class, then there would be grounds for a lawsuit.

Only if there is enough evidence. Yes, I can say that the inability to account for things like the ADA in the US can place an employer in hot water, however, since LC doesn't make those decisions, they are immune. The accountability is placed upon the employer. Don't hate the players or the game. Maybe just figure out how to fix it without harming everyone, be popular enough to make said idea into law, and get into a position of power that allows you to do so. If that sounds hard, congrats, welcome to the reason why I never got into politics. Don't even get me started on all the people you will never realize you are hurting by fixing that one single problem.

Re: Many hard LeetCode problems are easy constraint problems

#358
post #190

Earlier quoted context omitted.

> Read wikipedia and it seems to mean....use a recursive function? Yes, that's one (common) approach to dynamic programming. The recursive function call are memoized so that previous calculations are remembered for future function calls. Overlapping subproblems become trivial if you can reuse previously computed values. The recursion with memoization is top-down dynamic programming.

So all in all pretty basic stuff. Why would anyone worth their salt should have problem with that?

The hard part is realizing that the problem you're solving efficiently maps to a dynamic programming algorithm. You have to spot the opportunity for sub-problem reuse, or else the solution looks something like cubic or exponential (etc.)

Re: Many hard LeetCode problems are easy constraint problems

#359

Earlier quoted context omitted.

People don't miss that about interviews, they just know that the balance of power is so skewed that the interests of the employer become the only relevant part. The employer can keep going through hundreds of applicants until they find someone who's literally perfect in every single way, they have nearly unlimited time. Meanwhile, the applicants need a job now, any job at all, they're on a hard time limit until their…

I have to push back on the unlimited amount of time thing. Maybe in FAANG that’s true but in the places I’ve worked for, hiring is something that comes down from on high - someone tells us they need N bodies for some project, and we need to have a team hired by some deadline. We really can’t interview endlessly.

I don't mean that you're literally allowed to run interviews for years. I mean that companies can, if they choose to, interview people indefinitely until they find a suitable candidate. The company won't collapse if they don't find an employee by the deadline, it's not imperative to their existence, it's just a nice to have, a goal. Maybe some project or initiative doesn't pan out or gets pushed back if no one gets hired, but the impact of all that seems rather limited. On the other hand, my existence is fully contingent on finding a job, and if I overrun the deadline I have to find a place to work, I won't be able to eat and pay rent. My time limit is existential, their time limit is artificial and fully in the realm of planning.

Re: Many hard LeetCode problems are easy constraint problems

#360

Earlier quoted context omitted.

I feel like I'm entering a whole different universe on HN. Maybe things are this equal and fair on the senior, high-paying part of the spectrum that most people here seem to occupy, but in general there's a huge power imbalance in job interviews. Unless you're special and the company wants you in particular, it costs them nothing to turn you down in favor of the other 10000 perfect applicants, while you must find a j…

I agree that doing that without asking if they really mean "any" would in fact demonstrate traits that might be bad for a co-worker. If the candidate reads that this may be the case, asks for, obviously, that reason, and the interviewer confirms that they mean "any", then it's a red flag for that interviewer , at least, as a co-worker, if they go on to get upset over your choice, unless it's something where you're ob…

Yeah, I don't mean to justify the actions of the interviewer, they were likely in the wrong here. It's just that, to someone in my position, it seems almost funny to be willing to throw the entire interview over something like that. It's them who gets to decide your fate.

Also, we can't know what exactly was said, so maybe miscommunication could be partly to blame. Like, "Are you sure I can use any language? (Are you really so gracious as to give me this option?)" vs. "Are you sure I can use any language? (Can I use something you definitely don't know?)"

Post reply on HN