Man, I thought I could get away with not practicing these irrelevant questions after working for a while, turns out I was wrong. Just got asked a two dimensional DP question and failed the interview. Going back to leetcoding now.
DP is good.. what's the issue here?
Google and quora asked me dp
Would you rather be asked to find relevant code from a codebase to copy/paste and solve a problem? That would be more realistic to the majority of programmers jobs but the point is to show that you can solve tricky problems for unique situations.
True, but there are algorithms that are more relevant which we do write.
Tech interviews always been about passing the "test". Imagibe when you are trying to go to prestige universities where lots people want to come, so yoh need to prep yourself to get high score on the entrance tests to get considered. Most of the questions you probably rarely seen or wont see it again in your day to day life. Sucks? Yeah indeed, but lots of people wan to work for companies with high TC so supply and demand ...
Why is DP irrelevant? If one has to name an irrelevant area, I'd say it's linked lists manipulation. Totally irrelevant, unless you code smth in Linux kernel.
True that, though I can’t say I’ve actually ran into a linked list question though except for reverse a linked list.
What's your problem with DP? Just learn it, it's not difficult.
Why should you learn something which is irrelevant is the question
Really? Not that difficult? Can you solve burst balloons - lc312? Unique bsts ii - lc95? Maximal rectangle - lc85 if you have never seen it before and have never seen largest rectangle in histogram? Remove boxes - lc546? I have done 60 or so DP problems on leetcode and spent many many hours prepping and I agree that some of the classic problems or ones that are very similar to the classic problems are not too bad after practice. But there are a lot of DP problems that can be extremely difficult even for someone who has practiced a lot. These are some of the hardest problems on all of leetcode if you have never seen them before
they don’t use dp in work, but they need smart coder in work
what they looking for sometimes is CPU rather than an ASIC
Dp questions are easy as long as u have seen it. Its of course very easy to ask. If one hasnt seen it before, it requires a genius to get a working solution for a dp problem within 30-45 mins. Leetcoding has made interviews very boring as the only metric these days is about reproducing the memorized solutions. Creativity is almost dead.
Yeah I got asked matrix chain multiplication recently at FANG.
Which company was it?