Study
Memoization vs Tabulation in DP Interviews at Senior Level
TrueInterview
November 2, 2026 · 14 min read

Write the memoized recursion first in most dynamic programming rounds, then convert it to a bottom-up table with rolling state when the input size or a follow-up asks for it. As of 2026-11-02, TrueInterview's bank holds 126 candidate-reported dynamic programming questions from 22 big-tech companies, and most of them carry a phone-screen report. The DSA Handbook describes the two styles as the "Same recurrence, two implementation strategies, identical asymptotic complexity". Our take: the style is not what earns credit. A correct recurrence reached fast gives you the best shot in a phone screen, and the conversion you can explain is where we would expect a senior candidate to stand out.
Disclosure: TrueInterview is an interview-preparation product and publishes this article. Facts about other products come from their public pages on the dates listed under Sources.
How do memoization and tabulation compare in an interview?
AlgoCademy's guide defines memoization as the top-down approach to dynamic programming and tabulation as the bottom-up approach. In an interview they differ in four places: which states get computed, how deep the call stack goes, how far space can shrink, and where bugs hide. The table sets each difference against the guide that states it.
| Criterion | Memoization (top-down) | Tabulation (bottom-up) |
|---|---|---|
| Asymptotic time | Same time complexity as tabulation, per Simple2Code's tutorial | Same asymptotic time; GeeksforGeeks says it wins by a constant factor when every subproblem must be solved |
| States computed | Only the subproblems the answer needs, per GeeksforGeeks | Every subproblem up to n, per Simple2Code's tutorial |
| Call stack | Deep recursion can hit a language's limit, per Simple2Code's tutorial; Python's default limit is 1000, per the DSA Handbook | No recursion, which AlgoCademy's guide says eliminates the risk of stack overflow |
| Space after optimization | The cache keeps every state it visited | Rolling arrays cut O(n) or O(n*W) to O(1) or O(W), per the DSA Handbook |
| Where bugs hide | A missing base case or an incomplete cache index | A wrong fill order silently produces wrong answers, per the DSA Handbook |
| Speed to a first correct answer | Usually faster to get correct, per Simple2Code's tutorial | Needs the dependency order worked out before the loops |
| Best for | Phone screens, sparse or multi-parameter state, and the first pass on any problem | Large one-dimensional inputs in Python or Java, OA hidden tests, and the space follow-up |
Verdict, memoization: wins for the first answer and for sparse or multi-parameter state.
Verdict, tabulation: wins for large one-dimensional inputs and for any question that ends in a space follow-up.
Do big-tech interviewers prefer one style?
The published guides disagree, so neither style is a safe bet on its own. Simple2Code's tutorial says "In an interview setting, either is generally acceptable". The DSA Handbook says "The standard interview expectation on LC's 1D and 2D DP problems is the iterative form". No source here shows how DP answers are graded at these companies, and our bank records which questions candidates reported, not how answers were scored. The style advice in this article is therefore our recommendation, derived from problem shape, input bounds and round.
Our take: produce both. The memoized form proves you found the recurrence, and the iterative form answers the handbook's expectation when the interviewer holds it.
When every subproblem is needed, tabulation is faster only by a constant factor, not by complexity class. The DSA Handbook cites CLRS for bottom-up methods having better constant factors because they avoid recursive call overhead. For rod cutting, GeeksforGeeks gives both versions the same O(n^2) time and O(n) space. Claim a constant-factor gain if you switch, never a better complexity class.
Which DP questions do big-tech candidates report, and in which rounds?
Phone screens carry most of the reports: 81 questions have a phone-screen report, 40 an onsite report and 16 an online assessment report, and one question can appear in more than one round. By company, the bank has 20 filed under Google, 17 under Amazon, 13 under Uber, and 12 each under ByteDance, Meta and Snowflake. Recency is high, with 108 of them last reported in the 12 months before 2026-11-02.

Treat those counts as a map of what candidates wrote up, not as how often a company asks DP. These are candidate-reported questions reconstructed for practice, not any company's official list. The useful part is the short list of titles that keeps recurring:
| Question | Companies | Write-ups linked | Dated report | Style to lead with |
|---|---|---|---|---|
| Trapping Rain Water | Apple, Amazon, ByteDance, Meta | 15, of which 4 senior-or-above | Apple phone screen, 2026-09 | Prefix and suffix maximum arrays are a table by nature; compress to two pointers |
| Jump Game Prime | Uber | 9 | Uber OA, 2026-06 | Bottom-up, tested at the largest bound in the statement |
| House Robber Series | Databricks, Amazon, Meta | 8, of which 1 senior-or-above | Databricks phone screen, 2026-09 | Memoize on the index, then two rolling variables |
| Maximum Profit in Job Scheduling | Snowflake, Airbnb, Google, Pinterest | 6, of which 2 senior-or-above | Snowflake phone screen, 2026-09 | Memoize on the job index with a binary search for the next compatible job |
| Make Array Bitonic | Amazon | 5 | Amazon OA, 2026-08 | Bottom-up, tested at the largest bound in the statement |
| Splitwise: Settle Balances and Minimize Transactions | 5, of which 4 senior-or-above | Pinterest phone screen, 2026-10 | Memoize over a bitmask of the non-zero balances | |
| Best Time to Buy and Sell Stock IV | Meta, Amazon, Apple, Lyft, Microsoft | 3, of which 2 senior-or-above | Meta phone screen, 2026-08 | Memoize on (day, transactions left, holding), then tabulate over transactions |
| Maximal Square | Salesforce | 3, of which 2 senior-or-above | Salesforce onsite, 2026-07 | A grid table by nature, compressed to one row |
Most dated examples above come from phone screens, where we would lead with a fast memoized answer. For the two OA titles we recommend the opposite habit: submit the version you have already run at the maximum input size, since hidden tests may include it.
The last column is advice, not a record of how these answers were graded. A dynamic programming tag says how a question was filed, and Trapping Rain Water is the clearest case where a non-table solution (two pointers) is the usual final answer.
Why write the memoized recursion first in a phone screen?
Because the phone screen is where most of these reports sit, and a cached recursion is the shortest path to a correct answer on a short clock. AlgoCademy's guide says memoization "often allows for quicker initial implementation, making it useful for prototyping or coding interviews". GeeksforGeeks says memoized code is easy to write by modifying the underlying recursive solution.
The DSA Handbook describes Erickson's framing as "memoize, then tabulate": write the recursion, confirm it with a memo, and convert only for the constant-factor or space gain. That order matches the phone-screen setting. Say the state, the transition and the base case out loud, write the recursion, then add the cache. If the interviewer agrees with the recurrence before you type, most of the later steps become mechanical.
We would still start here at senior level. The difference is that you finish with a sentence on whether the bound allows the recursion, before the interviewer asks.
How do you convert to bottom-up and shrink the state?
Conversion is where the two styles actually differ in an interview, and it is the follow-up to plan for. The DSA Handbook says "Bottom-up admits the rolling-pair compression that drops space from O(n) or O(n*W) to O(1) or O(W)". Simple2Code's tutorial advises converting once the recursive structure, and with it the table's dependencies, is clear.
Use the memo you already wrote as the specification:
- List the parameters of the memoized function. They become the table's dimensions.
- Read which smaller states each call depends on. The loop must fill those first.
- Turn the recursion's base cases into the table's initial cells.
- Check which earlier rows or cells the transition reads. Keep only those, and the table becomes rolling variables or a single row.
AlgoCademy's guide says tabulation can allow easy space optimization by keeping only a few previous states. Simple2Code's tutorial adds that "being able to explain the tradeoff between the two" can matter as much as the code. So close every conversion with one sentence: the time is unchanged, the stack is gone, and space fell from the table to the window the transition reads.
Worked example: how does House Robber go from a memo to two variables?
House Robber Series is linked from 8 candidate write-ups and was reported in a Databricks phone screen last seen in 2026-09. It is the cleanest drill for the full sequence, because the recurrence is short and the follow-up has a reported large-input variant.
Start top-down. The state is the house index, and each house is either skipped or robbed:
from functools import lru_cache
def rob(nums):
@lru_cache(maxsize=None)
def best(i):
if i >= len(nums):
return 0
return max(best(i + 1), nums[i] + best(i + 2))
return best(0)
That is correct, and it is the answer to give first. The risk is depth: the recursion holds one frame per house, and the DSA Handbook says Python's default recursion limit is 1000. House Robber (Large Inputs) is linked from 2 senior-or-above write-ups and 1 junior one, and its title tells you which follow-up to expect.
Convert by filling from the last house backwards, since best(i) reads only larger indices:
def rob(nums):
n = len(nums)
dp = [0] * (n + 2)
for i in range(n - 1, -1, -1):
dp[i] = max(dp[i + 1], nums[i] + dp[i + 2])
return dp[0]
Each step reads only the next two cells, so the table collapses to two rolling values:
def rob(nums):
next1 = next2 = 0 # best(i + 1), best(i + 2)
for x in reversed(nums):
next1, next2 = max(next1, x + next2), next1
return next1
All three run in O(n) time. Space goes from an O(n) cache plus an O(n) stack, to an O(n) table, to O(1). Saying why the time stayed and the space fell is the answer to the tradeoff question.
When should you start bottom-up instead of memoizing?
Start bottom-up when the bound on a one-dimensional recurrence is large and you write Python or Java. The DSA Handbook says "For LeetCode problems where n reaches 10^4 or 10^5 on a 1D recurrence, bottom-up is the safer default in Python and Java". The same handbook frames the interview line as one approach running out of stack on a 10^5-element input while the other drops to O(1) space.
AlgoCademy's guide lists stack overflow on deeply recursive problems as a disadvantage of memoization, and says tabulation is safer for large inputs that might overflow the stack. Raising the recursion limit is a patch an interviewer can fairly question, so treat the bound as the deciding input.
The online assessment is the other case. Among the 16 questions with an OA report, Uber's Jump Game Prime and Amazon's Make Array Bitonic are the dated examples in the table above. Assume the hidden tests include the largest input the statement allows, and that no one will be there to hear that the recursion would pass with a bigger stack. Submit the bottom-up form you have already run at that size.
When is memoization the better choice on purpose?
Choose memoization deliberately when the reachable state space is sparse or the state has several changing parameters. The DSA Handbook's advice is "Memoization when the state space is sparse". AlgoCademy's guide says memoization can be easier with several changing parameters because tuples can serve as cache keys, and more space-efficient when only a small subset of subproblems needs solving.
Best Time to Buy and Sell Stock IV is the reported example to drill. Its state is day, transactions left and whether you hold a share, and a tuple-indexed memo gets that right on the first pass. Wildcard and regex matching with a * operator, linked from 2 senior-or-above write-ups, is another multi-parameter state: two indices and a branching transition.
Tabulation is not the safe option here. The DSA Handbook describes a failure mode where the candidate "writes the loops before the recurrence is correct" and ships a silent bug. On multi-parameter problems, build the table only after you can name the fill order out loud.
What changes at senior and staff level?
The level data is thin at the top, so the senior-leaning list is short; treat it as a hint about what to drill, not a measured pattern. Candidate write-ups link these questions 43 times from candidates who reported a senior, staff-plus or manager level, and 147 times from candidates who reported junior, new-grad or intern. Best Time to Buy and Sell Stock is linked from 3 senior-or-above write-ups.
In the table above, Splitwise, Stock IV and Maximal Square are the rows with a known senior-or-above majority, and House Robber (Large Inputs) adds a large-input twist. By topic, bit-manipulation tags lean senior at 6 senior-or-above against 3 junior-or-below links. If you target a senior loop, give bitmask state extra time, since one standard technique for minimizing settlement transactions is DP over a bitmask of the non-zero balances. Staff-plus or manager write-ups include a Word Break variant and Maximum Subarray Sum After K Concatenations.
Our take: at senior level a memoized answer is the floor. Expect to justify top-down or bottom-up against the stated bound, and to produce the space-reduced iterative form without being asked.
Down-leveling note (our view): no source here measures how coding answers are scored for level, so treat this as a risk to manage rather than a rule. A correct memo that needs two prompts to become a loop, or a space reduction you cannot explain, can read as less senior even when the code passes. Lead the tradeoff discussion yourself.
Which style should you use in each round?
Decide by round and bound, using the round split from the reported questions above. The rule below is our view, built from the guides cited in each row.
| Situation | Lead with | Prepare for |
|---|---|---|
| Phone screen, small bound | The memoized recursion | Converting on request and naming the space saving |
| Onsite | The form you can state fastest, then the table | The conversion and space reduction as the follow-up |
| Online assessment | Bottom-up, run at the largest stated input | Hidden tests that may include the maximum bound |
| One-dimensional recurrence, bound of 10^4 or more, Python or Java | Bottom-up from the start, per the DSA Handbook | Rolling variables |
| Several changing parameters or sparse states | A memo on a tuple of the parameters | Naming the fill order before you tabulate |
If two rows apply, the bound wins: a large one-dimensional input in Python goes bottom-up even in a phone screen.
How we counted
Counts come from TrueInterview's question bank as of 2026-11-02: 126 dynamic programming questions at 22 big-tech companies, and one question can be reported in more than one round. Level counts are links from candidate write-ups using the level each candidate reported, so they show who wrote up a question, not who was asked it. TrueInterview says reports are written up right after the interview and sorted by company and round. Every question in this set is DP by construction, so topic shares describe secondary tags only.
FAQ
What is the difference between memoization and tabulation?
GeeksforGeeks says both techniques apply when there are overlapping subproblems. Memoization runs the recursion and caches each result the first time it is computed, so only the states the answer reaches get solved. Tabulation fills a table from the smallest subproblem up to the full size with loops, so you choose the order and can drop rows you no longer need. They implement the same recurrence; the differences are the call stack, the order of work and how far the space can shrink.
Is a memoized solution accepted as a complete answer?
Simple2Code's tutorial recommends starting with the memoized version as a practical default because it is usually faster to get correct. The sources disagree on whether it is the expected final form, as the section on interviewer preferences sets out. Treat a correct memo as a complete first answer, and offer the iterative conversion yourself before the interviewer asks.
Are the time and space complexities the same?
The asymptotic time is the same, because both solve each distinct state once. AlgoCademy's guide shows memoization taking its Fibonacci example from O(2^n) to O(n) time, which a table matches. Space differs in practice: memoization pays for a cache and a call stack, while tabulation pays only for the table and can then shrink it to the window the transition reads. If the interviewer asks for better space, the table is the route.
When does recursion depth make memoization risky?
Simple2Code's tutorial notes that very deep recursion can hit a language's recursion limit. The risk is highest when the recursion advances one position per call, as in House Robber or the day index of Stock IV, because the depth then equals the input length. Read the bound before choosing: if one frame per element would exceed your language's limit, write the loop first. On grid path problems the depth is about the sum of the two dimensions, which is usually far smaller.
Does the expectation change for senior candidates?
The reported titles change more than the format. Several of the senior-leaning questions in the bank are multi-parameter, bitmask or large-input variants, which are the problems where the choice of style and the space follow-up matter most, though the senior sample is small. Senior-or-above candidates file far fewer of these write-ups than junior candidates, so the senior-leaning titles named in the senior section make a short list to drill. The senior section above sets out what to raise unprompted.
Your practice plan
A suggested pace for someone working full time, over three weeks:
- First week, phone-screen drill: solve House Robber Series and Maximum Profit in Job Scheduling top-down against a timer, saying the state, transition and base case aloud before you write the cache.
- First week, second half: convert both to a table and then to rolling state, and explain aloud why the time stayed the same while the space fell.
- Second week, multi-parameter state: memoize Best Time to Buy and Sell Stock IV on a tuple, then tabulate it over transactions; do the same with Word Break.
- Second week, table-native problems: solve Maximal Square and Trapping Rain Water bottom-up, then compress to one row and to two pointers.
- Third week, OA conditions: solve Jump Game Prime and Make Array Bitonic in your interview language and run each at the largest bound the statement allows.
- Third week, senior follow-ups: work Splitwise: Settle Balances and Minimize Transactions and Best Time to Buy and Sell Stock in both styles, and lead the tradeoff discussion without a prompt.
- Before every problem: read the input bound and your language's recursion limit, and choose top-down or bottom-up from those, not from habit.
Sources
- TrueInterview question bank — dynamic programming at big-tech companies — counted 2026-11-02
- Memoization vs tabulation, top-down vs bottom-up - The DSA Handbook — checked 2026-11-02
- When to Use Memoization vs Tabulation: A Comprehensive Guide – AlgoCademy Blog — checked 2026-11-02
- Memoization vs Tabulation Explained (DP) | Simple2Code — checked 2026-11-02
- Tabulation vs Memoization - GeeksforGeeks — checked 2026-11-02
- Real FAANG Interview Questions by Company · TrueInterview — checked 2026-11-02
Last reviewed: 2026-11-02.