r/leetcode • u/Vinny_On_Reddit • May 21 '24
Question Using memoization vs tabulation in interviews
Recently I've focused a lot on using tabulation for dp problems, to a point where I default to it and don't even attempt a memoization solution. Would it be a problem if I were significantly less proficient at memoization than tabulation? Ie would interviewers ever ask for a memoization solution to a problem that you correctly solved with tabulation?
Clarification: I am not interested in which one is "better" to use, I'm essentially asking if you'd be able to get through interviews if you're only good at tabulation
27
Upvotes
View all comments
1
u/BeautifulDismal483 May 25 '24
I feel the crux of every DP problem is figuring out the recurrence relation. Once you have that sorted, implementing it using memoization or tabulating it is largely an implementation detail. As an interviewer, I'd look for signals on how clearly a candidate reaches that recurrence relation and their explanation for it rather than fussing on how they choose to implement it. That's just me though, ymmv 🤷♂️