3 ms·
For me it was a bit the other way around. I solved the problem in a brute force way and on interviewer's asking, was flopping to come up with a better algorithm
by fizixer 8y ago
For me it was a bit the other way around. I solved the problem in a brute force way and on interviewer's asking, was flopping to come up with a better algorithm. Then he mentioned that I should consider DP.
Unfortunately my DP was really bad so I knew right then I'm going to flop. And flop I did.
For me the two weakest points are DP, and coming up with the right O() estimate for an algorithm that I just created on the whiteboard, and am looking at it for the first time in my life. Would love advice on how to get good at both.
- moufestaphio 8y agoFor DP? Practice a couple on like HackerRank, CodeFights etc. It starts to make sense after you do a few. For Big O notation? Just think about how many times you're iterating through things (in the worst possible case). e.g. Got two nested for loops each going to N.. we're going to loop N on the outer loop, so and each iteration of the inner loop we go through N times? that's N x N so O(N^2).. (easy example obviously).