Live data from Hacker News

Many hard LeetCode problems are easy constraint problems

buttondown.com

371–380 of 551 posts

Re: Many hard LeetCode problems are easy constraint problems

#371
post #214

Earlier quoted context omitted.

There's even a rocket emoji in server console.logs... There are memes with ChatGPT and rocket emojis as a sign of AI use. The whole repo looks super vibe-coded, emojis, abundance of redundant comments, all in perfect English and grammar, and the readme also has that "chatty" feel to it. I'm not saying that using AI for take-home assignments is bad/unethical overall, but you need to be honest about it. If he was lying…

Oh my god Becky, there's even a rocket emoji in the server console logs! Should I also be "honest" about tab-completion? Where do you draw the line? Maybe I should be punished for having an internet connection too. Using AI for docker/readme's/simple scaffolding I would have done anyways ? Oh the horror! There was no lying because there was no discussion or mention of AI at all. Had they asked me, I'd have happily to…

> Should I also be "honest" about tab-completion? Where do you draw the line?

I'd probably draw it somewhere in the miles-long gap between tab completion and generating code with an LLM. It sounds like that's where the company drew it too.

Re: Many hard LeetCode problems are easy constraint problems

#372

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…

Reminds me of https://aphyr.com/posts/340-reversing-the-technical-intervie... (and the follow-ups to it)

Re: Many hard LeetCode problems are easy constraint problems

#373
post #210

Earlier quoted context omitted.

That is what people miss about interviews. Often when you interview you don't have reasonable leads on any other job and so you don't feel like there is a choice since you likely need a job (unemployment rarely pays as well as a job). However interviews are not only about the company deciding if they will hire you, they are also about do you want to work there and convincing you to take the job if one is offered. So…

> So make sure you use those "do you have any questions" time to ask questions! I started giving interviews again and im surprised how many people dont ask anything. I'm an IC, not a hiring manager, and only evaluating a specific thing, (technical assement) and still nothing really.

It just goes to show how skewed the power balance is right now. People are probably afraid to make an extra move that can deduct points for any obscure reason.

When I interview people I encourage them to ask any question they want and I make damned sure it doesn't reflect in my report to the higher-ups! Just imagine being in their shoes, you could be in the same position tomorrow!

Re: Many hard LeetCode problems are easy constraint problems

#374
post #119

Earlier quoted context omitted.

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.

> Why would you ever want to work somewhere that clearly employs such unqualified individuals Because you're unemployed and need to work to get some money. Do you think you're a super intelligent person when you couldn't even figure that out?

It goes without saying that someone needing money that badly wouldn't do what the OP here did. Stop trying to be right and start trying to see the world for what it is. It'll help you do better.

Re: Many hard LeetCode problems are easy constraint problems

#375
post #12

> The "smart" answer is to use a dynamic programming algorithm, which I didn't know how to do. So I failed the interview. Really? This kind of interview needs to go away. However, coding interviews are useful. It's just that "knowing the trick" shouldn't be the point. The point is whether the candidate knows how to code (without AI), can explain themselves and walk through the problem, explain their thought processes…

The bar is so high nowadays that simply being able to talk intelligentyly about the problem, ask clarifying questions, getting an inefficient solution and coding it up well does not pass muster. Even getting an efficient algorithm basically right, is no guarantee. In some cases there might be alternative solutions which have some tradeoffs, and you might have to come up with those, as well Miss a counterexample? Even…

It might be true in the general case, I haven't interviewed for a job for some years, so I may be out of touch.

All I can say is that I do conduct interviews, and that I follow the above philosophy (at least for my round).

Re: Many hard LeetCode problems are easy constraint problems

#376
post #268
post #35

Earlier quoted context omitted.

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.

You'd need a fancy encoding for SAT to use a small DPLL implementation.

Otherwise, customize DPLL for this particular problem.

Re: Many hard LeetCode problems are easy constraint problems

#377

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.

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

That wouldn't be hard to do. Given the disparate impact standard, everything is biased against a protected class.

Re: Many hard LeetCode problems are easy constraint problems

#378

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…

It is and isn't. I'd argue it's not memorizing exact solutions(think copy paste) but memorizing fastest algos to accomplish X. And some people might say well, you should know that anyways. The problem for me is, and I'm not speaking for every company of course, you never really use a lot of this stuff in most run of the mill jobs. So of course you forget it, then have to study again pre interview. Problem solving is…

> memorizing fastest algos

I don't think most LC problems require you to do that. Actually most of them I've seen only require basic concepts taught in Introduction to Algorithms like shortest path, dynamic programming, binary search, etc. I think the only reason LC problems stress people out is time limit.

I've never seen a leetcode problem that requires you to know how to hand code an ever so slightly exotic algorithm / data structure like Fibonacci heap or Strassen matrix multiplication. The benefit of these "fastest algos" is too small to be measured by LC's automatic system anyway. Has that changed?

My personal issue with LC is that it has a very narrow view of what "fast" programs look like, like most competitive programming problem sets. In real world fast programs are fast usually because we distribute the workload across machines, across GPU and CPU, have cache-friendly memory alignment or sometimes just design clever UI tricks that make slow parts less noticeable.

Re: Many hard LeetCode problems are easy constraint problems

#379

Earlier quoted context omitted.

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…

I never meant to imply that LC would be violating the law.

Re: Many hard LeetCode problems are easy constraint problems

#380
post #214

Earlier quoted context omitted.

There's even a rocket emoji in server console.logs... There are memes with ChatGPT and rocket emojis as a sign of AI use. The whole repo looks super vibe-coded, emojis, abundance of redundant comments, all in perfect English and grammar, and the readme also has that "chatty" feel to it. I'm not saying that using AI for take-home assignments is bad/unethical overall, but you need to be honest about it. If he was lying…

Oh my god Becky, there's even a rocket emoji in the server console logs! Should I also be "honest" about tab-completion? Where do you draw the line? Maybe I should be punished for having an internet connection too. Using AI for docker/readme's/simple scaffolding I would have done anyways ? Oh the horror! There was no lying because there was no discussion or mention of AI at all. Had they asked me, I'd have happily to…

> It's an unpaid take-home assignment

It's not defensible in any case.

That being said, I think the CTO's "vide coding paranoid" after seeing this repo is 100% justified.

Post reply on HN