3 ms·
All problems solved using DP can also be solved using global optimization techniques. A much easier one to implement in an interview than most DP solutions are
by Der_Einzige 3y ago
All problems solved using DP can also be solved using global optimization techniques. A much easier one to implement in an interview than most DP solutions are simple genetic algorithms. Yes, DPs really do solve any silly interview problem and even have several advantages to boot (i.e. partial solutions if stopped before they're finished).
Anyone interviewing you who won't give you a pass for solving the leetcode problem the "wrong way" without strong very strong justifications is a fool who themselves shouldn't be working in tech.
- qsantos 3y agoDid you encounter practical problems where genetic algorithms work well? So far, the only serious usage I did was for CodinGame's Mars Lander optimization problem (and it works pretty well there!).
- anon291 3y agoGenetic algorithms are not deterministic, whereas a DP solution is going to be deterministic with very easily calculable bounds on execution time. Comparing the two as you do, in my opinion, shows a fundamental gap in algorithms understanding.
- nottorp 3y agoBut they didn't say 'use LLMs... in Rust' :) Points for that.
- deleted 3y ago[deleted]