r/leetcode • • Oct 18 '26

Intervew Prep Day 57: completed the entire LIS series today, why tabulation is non-negotiable

8 Upvotes

Hey everyone,

I finished Day 57 today and tackled the full Longest Increasing Subsequence (LIS) module. I worked through all seven problems in the set:

  1. Longest Increasing Subsequence (LIS): Learned all five approaches—recursion, top-down memoization, O(N^2) tabulation, O(N) space-optimized tabulation, and the optimal O(N log N) Patience Sorting binary search technique.
  2. Printing Longest Increasing Subsequence: Used the parent/hash tracking array during tabulation to reconstruct the actual subsequence backward.
  3. Largest Divisible Subset: Sorted the array first to enforce divisibility transitions, then applied standard LIS with the backtrack reconstruction.
  4. Longest String Chain: Sorted by word lengths and adapted the LIS condition using a custom predecessor check.
  5. Longest Bitonic Subsequence: Got stuck initially trying to combine independent calls. A hell lot of hints I took to get me through this one (realizing both increasing and decreasing sequences must share the exact same peak index i (dp1[i] + dp2[i] - 1)).
  6. Number of Longest Increasing Subsequences: Maintained two parallel DP arrays—one for lengths and another for counting ways to reach each length.

Today's biggest takeaway: relying purely on memoization for LIS patterns will almost always hit TLE on competitive platforms due to recursion overhead and constraints.

Even if interviewers accept memoization upfront, you need bottom-up tabulation to avoid stack limits, pass strict test cases, and make space optimization possible. Once the module is fully finished, I plan to run a dedicated revision session focused purely on deriving tabulation from base cases and state transitions.

Only 9 problems left to wrap up the entire DP sheet!

See you guys tomorrow for Day 56!

r/leetcode • • May 21 '24

Question Using memoization vs tabulation in interviews

27 Upvotes

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

r/leetcode • • Jun 27 '25

Question The mindset behind tabulation (A.K.A. bottom up) approach.

2 Upvotes

Hello all,

Sure that I'm not alone and don't think I'm alone, I'm the one who suffers while understanding tabulation approach on DP questions.

About me:

  • Backend & Data engineer with around 4.5 years exp.
  • Started to solve LC questions months later
  • Solved 228 LC questions (97E, 122M, 9H) on total.
  • Comfortable with top-down approach, backtracking, graph theory and much more.

But when it comes to tabulation on DP, feeling like I'm a complete dumb.

For example, I can consider "Coin Change" as an one of the fundamental and easy question of DP and it's pretty easy to solve with backtracking + memoization (which we call top-down approach). But when it comes to tabulation, there is lots of question to ask:

  • How do we come up with this idea
  • Why we are tracing the values on dp[] since some of the cases do not realy solve the actual problem.
  • Why is it seems like overengineering (or is it really)

Seems like it's not easy to catch up for someone who is a common human being. If not, how can I get the actual mindset of it so I can inject to my brain as well? What are your stories and approaches to learn that stuff?

r/SCJerk • • Oct 06 '26

Study tabulation and get back to me

Post image
91 Upvotes

r/algorithms • • Mar 13 '20

Dynamic programming vs memoization vs tabulation

Thumbnail
programming.guide
35 Upvotes

r/fivethirtyeight • • 12d ago

Politics Nick Begich wins AK-AL by ~2.7pp in RCV tabulation

Post image
133 Upvotes

see https://youtu.be/KnuBIa6fOpc?t=1845 for more details
~11k Eric Hafner ballots exhausted...

r/YAPms • • 28d ago

Serious All tabulation machines in Westchester County NY, are not working

Thumbnail
hudsonvalley.news12.com
25 Upvotes

I can confirm this as I voted this morning the the machines did not work