Live data from Hacker News

Many hard LeetCode problems are easy constraint problems

buttondown.com

261–270 of 551 posts

Re: Many hard LeetCode problems are easy constraint problems

#261
post #222

Earlier quoted context omitted.

I have been getting grilled on leet code style questions since the beginning my of my career over 12 years ago. The faangs jump and then the rest of the industry does some dogshit imitation of their process

I'm lucky I'm in the frontend webdev sphere then I guess instead of like being a pure backend guy. I've had a couple of those live ones and just denied them. I did manage to implement a "snake" algorithm once but got denied because I wasn't able to talk about time/space complexity.

As someone who’s hired 10s of engineers across multiple companies, it’s bullshit on the hiring side too.

It was humbling having to explain to fellow adult humans that when your test question is based on an algorithm solving a real business problem that we work on every day, a random person is not going to implement a solution in one hour as well as we can.

I’ve seen how the faangs interview process accounts for those types of bias and mental blindness and are actually effective, but their solutions require time and/or money so everywhere I’ve been implements the first 80% that’s cheap and then skips on the rest that makes it work

Re: Many hard LeetCode problems are easy constraint problems

#262
post #261

Earlier quoted context omitted.

I'm lucky I'm in the frontend webdev sphere then I guess instead of like being a pure backend guy. I've had a couple of those live ones and just denied them. I did manage to implement a "snake" algorithm once but got denied because I wasn't able to talk about time/space complexity.

As someone who’s hired 10s of engineers across multiple companies, it’s bullshit on the hiring side too. It was humbling having to explain to fellow adult humans that when your test question is based on an algorithm solving a real business problem that we work on every day, a random person is not going to implement a solution in one hour as well as we can. I’ve seen how the faangs interview process accounts for those…

>As someone who’s hired 10s of engineers across multiple companies

Any way to reach out? :)

I think it boils down to companies not wanting to burn money and time on training, and trying to come up with all sorts of optimized (but ultimately contrived) interview processes. Now both parties are screwed.

>It was humbling having to explain to fellow adult humans that when your test question is based on an algorithm solving a real business problem that we work on every day, a random person is not going to implement a solution in one hour as well as we can.

Tell me about it! Who were you explaining this to?

Re: Many hard LeetCode problems are easy constraint problems

#263

Earlier quoted context omitted.

100%. I just went through an interview process where I absolutely killed the assignment (had the best one they'd seen), had positive signal/feedback from multiple engineers, CEO liked me a lot etc, only to get sunk by a CTO who thought it would be cool to give me a surprise live test because of "vibe coding paranoia". 11 weeks in the process, didn't get the role. Beyond fucking stupid. This was the demo/take-home (fo…

Hah I feel you there. Around 2 years ago I did a take home assignment for a hiring manager (scientist) for Merck. The part B of the assignment was to decode binary data and there were 3 challenges: easy, medium and hard. I spent around 40 hours of time and during my second interview, the manager didn't like my answer about how I would design the UI so he quickly wished me luck and ended the call. The first interview…

That sucks so hard man, very disrespectful. We should team up and start out own company. I tried checking out your repo but this stuff is several stops past my station lol.

Re: Many hard LeetCode problems are easy constraint problems

#264
post #167

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…

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…

>The LC interviews are like testing people how fast they can run 100m after practice

Ah, but, the road to becoming good at Leetcode/100m sprint is:

>a slow arduous never ending jog with multiple detours and stops along the way

Hence Leetcode is a reasonably good test for the job. If it didn't actually work, it would've been discarded by companies long ago.

Barring a few core library teams, companies don't really care if you're any good at algorithms. They care if you can learn something well enough to become world-class competitive. If you can show that you can become excellent at one thing, there's a good chance you can become excellent at another thing.

That's basically also the reason that many Law and Med programs don't care what your major in undergrad was, just that you had a very high GPA in whatever you studied. A decent number of Music majors become MDs, for example.

Re: Many hard LeetCode problems are easy constraint problems

#265
post #240

Earlier quoted context omitted.

60k-120k euros. The upper 20k probably being entirely inaccessible so in reality probably like 70-100k euros.

It's always these low pay jobs that have the sloppiest interview experiences

In at least parts of Europe, 70k-100k is pretty good for a mid/senior developer.

Re: Many hard LeetCode problems are easy constraint problems

#266

Earlier quoted context omitted.

Would a good answer be "I can do it as a constraint problem, but since I guess you are not asking for this, the solution is..." and then proceed as usual?

Id probably stop the candidate, dig into how they’d using constraint based solvers, and how they might expect that to fall apart. Applicability and judgment is worth way more than raw algorithmic questions. One way to think about this is: Is a fresh graduate more likely to provide a solid answer to this than a strategic-thinking seasoned engineer? If so, just be conscious of what your question is actually probing. An…

I see, thank you

Re: Many hard LeetCode problems are easy constraint problems

#268
post #35

Earlier quoted context omitted.

General constraint solver would be terribly inefficient for problems like these. It's a linear problem and constraint solver just can't handle O(10^6) variables without some beefy machine.

FWIW, the OP's problem is not linear. It's an integer programming problem. A trick if you can't do a custom algorithm and using a library is not allowed during interview could be to be ready to roll your own DPLL-based solver (can be done in 30 LOC). Less elegant, but it's a one-size-fits-all solution.

You can implement DPLL in 30 lines of code? Not for SMT, I assume.

Re: Many hard LeetCode problems are easy constraint problems

#269

Earlier quoted context omitted.

Its not really memorizing solutions. Yes you can get quite far by doing so but follow ups will trip people up. However if you have memorized it and can answer follow ups, I dont see a problem with Leetcode style problems. Problem solving is about pattern matching and the more patterns you know and can match against, the better your ability to solve problems. Its a learnable skill and better to pick it up now. Persona…

I'd say that learning to solve tough LeetCode problems has very little (if not precisely zero) value in terms of you as a programmer learning to do something useful. You will extremely rarely need to solve these type of tougher select-the-most efficient-algorithm problems in most real-world S/W dev jobs, and nowadays if you do then just as AI. Of course you may need to pass an interview LeetCode test, in which case y…

If a position needs low-level from-scratch code so performance-critical, and needs it so quickly that the developer must recall all of this stuff from memory, any candidate likely wouldn’t be asked to give a technical interview, let alone some gotcha test.

Re: Many hard LeetCode problems are easy constraint problems

#270

Earlier quoted context omitted.

I meant no human-in-the-loop wrt hiring, which is what I thought you were getting at.

It's the same exact thing - if some company makes you jump through hoops to get hired that you find distasteful just don't apply to company.

Not all of us are market extremists. The “invisible hand of the market” doesn’t care about human rights.
Post reply on HN