Live data from Hacker News

Many hard LeetCode problems are easy constraint problems

buttondown.com

111–120 of 551 posts

Re: Many hard LeetCode problems are easy constraint problems

#112

Earlier quoted context omitted.

You're right, but that just shows how fundamentally silly this interview approach is. In any real engineering situation I can solve 100% of these problems. That's because I can get a cup of coffee, read some papers, look in a textbook, go for a walk somewhere green and think hard about it... and yes, use tooling like a constraint solver. Or an LLM, which knows all these algorithms off by heart! In an interview, I cou…

I was told to use ANY language in an interview. I asked them if they were sure, so I solved it with J. They were not too pleased and asked me if I could use another language, so I did prolog and we moved on to the next question. Then the idiot had the audacity to say I should not use "J and Prolog" but any common known language. I asked if assembly was fine, and they said no. Perhaps python or javascript. I did the r…

You're a hero!

Re: Many hard LeetCode problems are easy constraint problems

#113

Most interviews are based on the premise that if a diabetic can't synthesize their own insulin in their basement, they are somehow cheating at the game of life. If my wife's blood sugar is high, she takes insulin. If you need to solve a constraint problem, use a constraint solver. If your company doesn't make and sell constraint solving software, why do you need me to presume that software doesn't exist and invent it…

It’s explicitly not testing if you can synthesize insulin in a crisis, it’s a general aptitude test for “if we tell you you need to cram this textbook on how to synthesize insulin by next week and then ask you how to do it on a call, can you coherently repeat that back to us?”

Re: Many hard LeetCode problems are easy constraint problems

#114

> This was a question in a different interview (which I thankfully passed): > Given a list of stock prices through the day, find maximum profit you can get by buying one stock and selling one stock later. It was funny to see this, because I give that question in our interviews. If someone suggested a constraint solver... I don't know what I'd have done before reading this post (since I had only vaguely even heard of…

Something that works poorly is often better than something that doesn't work in an instant. This is what I have to tell myself every time I step into a massive, excessively complex mess of a codebase. Many business rules aren't clearly defined ahead of time in a way that always translates well to the code and starting over is a mistake more often than not imo.

Update... refactor... update... break off... etc. A lot of times, I'm looking at something where the tooling is 8+ years old, and the first order of business should be to get it working on a current and fully patched version of whatever is in place... replacing libraries that are no longer supported, etc. From there, refactor what you can, break off what makes sense into something new, refactor again. This process, in my experience, has been far more successful than ground up, new versions.

I say this while actively working on a "new" version of a software. New version being web based, "old" version being a winforms VB.Net app from over a decade ago. Old version has bespoke auth, new verion will rely on Azure Entra... Sometimes, starting over is the answer, but definitely not always.

Re: Many hard LeetCode problems are easy constraint problems

#115

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…

How does asking clarifying questions work when a non-programmer is tasked with performing the assessment, because their programmers are busy doing other things, or find it degrading and pointless?

Re: Many hard LeetCode problems are easy constraint problems

#116
post #61

Here’s my empirical evidence based on several recent “coding session” interviews with a variety of software companies. Background: I have been developing software for over 30 years, I hold a few patents, I’ve had a handful of modestly successful exits. I kind of know a little bit about what I am doing. At this stage in my career, I am no longer interested in the super early stage startup lifestyle, I’m looking at IC/…

Yes, it is a death spiral; if you are to lead them, you have to know what to fix when, to avoid making things worse. The solution is typically not just to fix their code. They got in over their heads by charging ahead and building something they'll regret, but their culture (and likely the interviewer personal self-regard) depends on believing their (current) tech leaders. So yes, the interviewer is most comfortable…

I agree with everything you've written.

Clarifying my "YOLO" usage: I was being a little flippant, in the sense that when ending an interview early with direct critical feedback, the most likely outcome is a "burned bridge" with that company (you're never coming back).

Which reminds me one of my favorite twisted idioms: We'll burn that bridge when we get to it!

I guess I've finally found an acceptable real-world use case for this phrase :)

Re: Many hard LeetCode problems are easy constraint problems

#117
post #62

SAT, SMT, and constraint solvers are criminally underutilized in the software industry. We need more education about what they are, how they work, and what sorts of problems they can solve.

At least personally, I've been very underwhelmed by their performance when I've tried using them. Usually past a few dozen variables or so is when I start hitting unacceptable exponential runtimes, especially for problem instances that are unsatisfiable or barely-satisfiable. Maybe their optimizations are well-suited for knapsack problems and other classic OR stuff, but if your problem doesn't fit the mold, then it's…

Well, they aren’t magic. You have to use them correctly and apply them to problems that match how they work. Proving something is unsat is worst case NP. These solvers don’t change that.

Re: Many hard LeetCode problems are easy constraint problems

#118

Earlier quoted context omitted.

I was told to use ANY language in an interview. I asked them if they were sure, so I solved it with J. They were not too pleased and asked me if I could use another language, so I did prolog and we moved on to the next question. Then the idiot had the audacity to say I should not use "J and Prolog" but any common known language. I asked if assembly was fine, and they said no. Perhaps python or javascript. I did the r…

[flagged]

If the candidate asks if you're sure you want them to use any language and you say "yes", and then get pissy when they do, the candidate isn't the one who sabotaged anything and they're dodging a bullet if they "fail".

Re: Many hard LeetCode problems are easy constraint problems

#119

Earlier quoted context omitted.

I was told to use ANY language in an interview. I asked them if they were sure, so I solved it with J. They were not too pleased and asked me if I could use another language, so I did prolog and we moved on to the next question. Then the idiot had the audacity to say I should not use "J and Prolog" but any common known language. I asked if assembly was fine, and they said no. Perhaps python or javascript. I did the r…

[flagged]

Why would you ever want to work somewhere that clearly employs such unqualified individuals? And not only that, but allows those individuals to be the face of their company to prospective hires?

A company's interview process tells you a lot about how the company thinks and operates. This was was surely a dumpster fire.

Re: Many hard LeetCode problems are easy constraint problems

#120

Earlier quoted context omitted.

> 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…

> My biggest problem with leetcode type questions is that you can't ask clarifying questions. Yeah this one confused me. Not asking clarifying questions is one of the sureshot ways of failing an interview. Kudos if the candidates ask something that the interviewers havent thought of, although its rare as most problems go through a vetting process (along with leak detection).

[dead]
Post reply on HN