Is recursion + memoization an acceptable approach for these kind? Especially looking for feedback from people who interviewed at Snap. #engineering #software #swe
It's better than nothing, but if you can avoid recursion, it would be even better.
So you mean they expect the 2-D matrix approach?
I think he means exactly what he said...
Yes
Thanks! Is this based on any interview experience?
Nah bruh it needs to be bottom up DP with sprinkle of binary search to increase performance
ah do you need binary search?
Had a phone round with snap. Had a dp hard at the last 20 min. Only did memoization couldn't get to the dp solution. Almost a week now with no answer so I'm probably rejected
That sucks! Was it LC tagged? Not sure why they expect a 2D matrix approach. After memoization the time and space complexity should be equivalent to a matrix approach. Maybe it’s because of the unnecessary recursion calls?
Yeah. Some longest decreasing path in a matrix type of question
Haha “Hard DP” 😈
I thought the definition of Dynamic Programming WAS recursion + memorization?
Lol, no
Well, if by recursion he means calling functions/methods recursively, then hell no.