Top
Best
New

Posted by mpweiher 22 hours ago

Many hard LeetCode problems are easy constraint problems(buttondown.com)
529 points | 446 commentspage 3
FilosofumRex 5 hours ago|
SAT & CSP are criminally under utilized in CS classes, because profs have no clue about them.

That's why in so many industries they prefer to hire engineers and OR grads and teach them python, than hire SWE and teach them modeling

theendisney 9 hours ago||

   coins = [100,50,25,10,5,1]
   change = 1234;
   result = [0,0,0,0,0,0];
   for(i=0:i<coins.length;i++){
     while(change>coins[i]){
       result[i]++;
       change-=coins[i];
     }
   }
   //[12,0,1,1,4]
Coudnt help myself sorry
efortis 6 hours ago|
me neither

  function coin_change(change) {
    const coins = [25, 10, 5, 1]
    for (const coin of coins) {
      const n = change / coin | 0
      change -= n * coin
      console.log(coin, n)
    }
  }

  coin_change(25+10+5+1)
deepsun 7 hours ago||
As an interviewer, I gave one pretty simple task (people solved it in as little as 8 minutes), wasn't using any real CS, even though I'm good at it.

The reason was that aboint 70% of candidates couldn't write a simple loop -- to filter those out. The actual solution didn't matter much, I gave a binary decision. The actual conversation matters more.

Tade0 5 hours ago|
This. Main point of giving candidates CS problems was always to weed out those who couldn't program at all, but somehow were still in the industry. I worked with such people - it's unpleasant.

Somehow someone figured that giving harder problems should result in better candidates. Personally, despite having passed most of the tests I've been subjected to, I don't see the connection.

thomasahle 21 hours ago||
Interview:

> We can solve this with a constraint solver

Ok, using your favorite constraint solver, please write a solution for this.

> [half an hour later]

Ok, now how would you solve it if there was more than 100 data points? E.g. 10^12?

nemetroid 18 hours ago|
Maybe some preprocessing, maybe column generation, depends on the problem.
cerved 15 hours ago||
MiniZinc is a really great modeling language for constraint programming. Back in August I gave a talk at NordConstNet25 on how we used it to build a product configurator in what's (probably) the worlds largest MiniZinc model

https://pierre-flener.github.io/research/NordConsNet/NordCon...

jongjong 2 hours ago||
My Leetcode ability is unpredictable. I either ace the test or I can't finish it in time. The only way to make outcomes predictable is practice, but I have too much agency and not enough time for that.

Leetcode requires a very different set of skills from software engineering. Software engineering isn't so much about solving puzzles as it is about making good decisions. It's about knowing what's important and knowing where the boundaries are. It's about anticipating problems in their broadest form; creating just the right amount of flexibility and allowing the solution to solidify as your understanding of the problem deepens.

faangguyindia 21 hours ago||
I avoided all this just by becoming a contractor, i ship solution, no me tests me for leetcode ability
never_inline 21 hours ago||
> faangguyindia

> contractor

Do FAANG hire contractor in India?

monknomo 19 hours ago||
I mean, yeah, they do.
shutupnerd0002 21 hours ago||
[flagged]
gman2093 21 hours ago|||
apex predator of grug is complexity
awalsh128 21 hours ago|||
No me no nice
wolvesechoes 5 hours ago||
Whoever agrees to do LC problems during interview has zero dignity.
Jun8 14 hours ago||
An interesting meta problem is to determine antagonistic set of denominations, like the [10,9,1] example given in the post, to maximize the number of coins selected by the gradient method.
mgradowski 14 hours ago|
Isn't it trivially [1]?
gnarlouse 18 hours ago|
Been working on a calendar scheduling app that uses a constraint solver to auto schedule events based on scheduling constraints (time of day preferences and requirements, recurrence rules), and track goal progress (are you slipping on your desired progress velocity? Get a notification). It’s also a meal planner: from a corpus of thousands of good, healthy recipes, schedule a meal plan that reuses ingredients nearing expiration, models your pantry, estimates grocery prices, meets your nutritional goals. Constraint solvers are black magic.
cerved 15 hours ago|
Which solver do you use?
More comments...