Live data from Hacker News

Many hard LeetCode problems are easy constraint problems

buttondown.com

91–100 of 551 posts

Re: Many hard LeetCode problems are easy constraint problems

#91
post #60

Terrible question for an interview, and further highlights how our interviews are broken. Greedy algorithms tell you nearly nothing about the candidate's ability to code. What are you going to see? A single loop, some comparison and an equality. Nearly every single solution that can be solved with a greedy algorithm is largely a math problem disguised as programming. The entire question hinges on the candidate findin…

My best interview consisted of: -what projects have you done -what tech you worked with and some questions about decisions -debugging an issue they encountered before -talking about interests and cultural fit Instant green flag for me. Too bad that after receiving my offer covid happened and they had a hiring freeze.

This is how I prefer to interview. I don’t understand the mindset of LeetCode interviewers. It’s a weak signal because it’s easily gamed (false positives), and has misses too many strong candidates who have better things to do in their spare time (false negatives, bias towards one type of candidate -> lack of diversity in experience).

Re: Many hard LeetCode problems are easy constraint problems

#93

A loonnngggg time ago when I was green, and wasn't taught about constraint solving in my State University compsci program, I encountered the problem when trying to help a friend with his idea. He wanted to make an app to help sports club owners schedule players for the day based on a couple simple rules. I thought this was going to be easy, and failed after not realizing what I was up against. At the time I didn't ev…

This might be a dumb question (as I'm not familiar with constraint solvers) but would a linear optimization approach be better? I've used linear optimization for scheduling in the past. The nice thing is that linear optimization handles rule conflicts well, because you just set weights on all your rules and the optimizer will find the "least bad" solution to the conflicts.

Re: Many hard LeetCode problems are easy constraint problems

#94
I find this post interesting independent of the question of whether leetcode problems are a good tool for interviews. It's: here are some kinds or problems constraint solvers are useful for. I can imagine a similar post about non-linear least squared solvers like ceres.

Re: Many hard LeetCode problems are easy constraint problems

#95

Earlier quoted context omitted.

Selecting for people like themselves.

I think this is one of the more true answers but can you be more specific? Like in race? Like in wealth? Like in defection willingness? Like in corruption? Asking for a friend who is regularly identified as among the most skilled but feels their career has been significantly derailed by this social phenomenon.

Like in 'can solve a leetcode question quickly', because that's what the interview rubric asks them to test for.

Re: Many hard LeetCode problems are easy constraint problems

#96

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 one's i've gotten have all seemed more like tests of my puzzle solving skills than coding.

The worst ones i've had though had extra problems though:

one i was only told about when i joined the interview and that they would be watching live.

One where they wanted me streaming my face the whole time (maybe some people people are fine with that)

And one that would count it against me if i tabbed to another page. So no documentation because they assume i'm just googling it.

Still it's mostly on me to prepare and expect this stuff now.

Re: Many hard LeetCode problems are easy constraint problems

#97

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…

IMO leetcode has multiple problems.

1. People can be hired to take the test for you - surprise surprise 2. It is akin to deciding if someone can write a novel from reading a single sentence.

Re: Many hard LeetCode problems are easy constraint problems

#98

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…

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. Personally I've solved Leetcode style problems in interviews which I hadnt seen before and some of them were dynamic programming problems.

These days its a highly learnable skill since GPT can solve many of the problems, while also coming up with very good explanations of the solution. Better to pick it up than not.

Re: Many hard LeetCode problems are easy constraint problems

#99

Earlier quoted context omitted.

> If someone solves a leetcode hard with a constraint solver and you don't hire them, you are an idiot. I do hope you're exagerating here, but in case you aren't: this is an extremely simplistic view of what (software) engineers have to do, and thus what hiring managers should optimize for. I'd put "ability to work in a team" above "raw academic/reasoning ability" for the vast majority of engineering roles, any day.…

> I'd put "ability to work in a team" above "raw academic/reasoning ability" for the vast majority of engineering roles, any day. In this hypothetical, why do you do leetcode hard interviews?

One can be gifted while still producing code that the rest of the team can read.

Re: Many hard LeetCode problems are easy constraint problems

#100

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…

> My biggest problem with leetcode type questions is that you can't ask clarifying questions.

Huh? Of course you can. If you're practicing on leetcode, there's a discussion thread for every question where you can ask questions till the cows come home. If you're in a job interview, ask the interviewer. It's supposed to be a conversation.

> I wouldn't even mind the studying on leetcode types sites if they actually had decent explainers

If you don't find the hundreds of free explanations for each question to be good enough, you can pay for Leetcode Pro and get access to editorial answers which explain everything. Or use ChatGPT for free.

> It's not a matter of skill, it's just my ability to take in certain types of problems doesn't work well.

I don't mean to be rude, but it is 100% a matter of skill. That's good news! It means if you put in the effort, you'll learn and improve, just like I did and just like thousands and thousands of other humans have.

> Without any chance of additional info/questions it's literally a setup to fail.

Well with that attitude you're guaranteed to fail! Put in the work and don't give up, and you'll succeed.

Post reply on HN