Variadic Prefix Expression Evaluator
Medium · Coding & Algorithms · Software Engineer · Onsite
Problem Statement
Write a function evaluate(expr) that computes the integer value of a nested prefix expression. Each valid expression is either:
- A standalone integer literal (
int, excludingbool), which evaluates to itself, or - A non-empty Python
list[op, operand_1, operand_2, ...], whereopis"+"or"-"and every operand is itself an integer literal or a nested expression list.
Operator rules depend on both the symbol and how many operands follow it:
- Addition (
"+"): Accepts zero or more operands and returns their sum. When given zero operands (["+"]), return the additive identity0. - Subtraction (
"-"): Requires at least one operand:- One operand (
["-", x]): Returns the arithmetic negation-x. - Two or more operands (
["-", x_1, x_2, ..., x_k]): Subtracts left to right starting fromx_1, computing((x_1 - x_2) - ...) - x_k. - Zero operands (
["-"]): Invalid; raiseValueError.
- One operand (
Validate the entire structure during evaluation and raise ValueError whenever:
- Any expression list has length
0([]), - Position
0of a list is anything other than"+"or"-", or - The top-level input or any operand is neither a
listnor a genuineint(TrueandFalsemust be rejected even thoughboolsubclassesintin Python).
from typing import Union
def evaluate(expr: Union[int, list]) -> int:
...
Examples
Example 1
Input: expr = ["+", 6, -2, 9, 4]
Output: 17
All four operands are summed in order: 6 + (-2) + 9 + 4 = 17.
Example 2
Input: expr = ["-", 25, 8, 4]
Output: 13
With multiple operands, "-" groups from the left: (25 - 8) - 4 = 17 - 4 = 13.
Example 3
Input: expr = ["-", ["+", 12, 3], ["-", 6], ["+"]]
Output: 21
First ["+", 12, 3] produces 15, single-operand ["-", 6] negates 6 to -6, and zero-operand ["+"] yields 0. Folding the outer "-" from left to right gives (15 - (-6)) - 0 = 21.
Constraints
- Total items across all nested lists (
N):1 <= N <= 10^5. - Every integer literal in the input fits in signed 32-bit bounds (
-2^31 <= x <= 2^31 - 1), though intermediate sums or differences may exceed 32 bits. - Maximum list nesting depth (
D):0 <= D <= 1000. - Time complexity:
O(N). - Auxiliary space complexity:
O(D).
Step-by-step walkthrough
Understand prefix expressions and the three "-" cases
We want to evaluate nested prefix expressions (expressions where the operator comes before its operands, like
["+", 6, -2, 9, 4]) where operators are variadic (meaning they accept a variable number of operands rather than always two).Every valid expression is either a plain integer or a nested tree of lists:
["-", ["+", 12, 3], ["-", 6], ["+"]] --> (15 - (-6)) - 0 = 21 / | \ ["+", 12, 3] ["-", 6] ["+"] / \ | | 12 3 6 0 (empty sum -> 0) (unary negation -> -6)Let's check every operator rule and error condition before writing code:
- Addition (
"+"): Sums all operands left to right. Zero operands is valid and returns the additive identity:["+"] -> 0,["+", 9] -> 9,["+", 6, -2, 9, 4] -> 17. - Subtraction (
"-"): Has three distinct behaviors depending on operand count:0operands (["-"]): invalid -> raiseValueError.1operand (["-", a]): unary negation ->-a(for example,["-", 6] -> -6).2+operands (["-", a, b, c]): left-associative subtraction (grouped from the left) ->((a - b) - c).
- Invalid inputs (
ValueError): Empty list[], unsupported operator (like"*"or[1, 2]), or any operand/top-level value that is neither a list nor an integer. Watch out for a classic Python quirk:boolis a subclass ofint(isinstance(True, int)isTrue!), so we must rejectTrueandFalseexplicitly.
- Addition (
Start with natural recursion, then spot the stack-depth trap
Because nested lists form a tree, recursion is the first idea most engineers write. Notice one crucial space detail right away: if a single list has
99,999integers (["+", 1, 1, ..., 1]), building a temporary list[evaluate(x) for x in expr[1:]]would allocateO(N)memory even at depthD = 1, breaking theO(D)auxiliary space limit! Instead, we must fold each operand into a single running integer as soon as it finishes:def evaluate_recursive_draft(expr): if not isinstance(expr, list): if isinstance(expr, bool) or not isinstance(expr, int): raise ValueError("Invalid integer") return expr if len(expr) == 0 or expr[0] not in ("+", "-"): raise ValueError("Invalid expression list") op = expr[0] if op == "+": total = 0 for i in range(1, len(expr)): total += evaluate_recursive_draft(expr[i]) return total if len(expr) == 1: raise ValueError("'-' requires at least one operand") first = evaluate_recursive_draft(expr[1]) if len(expr) == 2: return -first for i in range(2, len(expr)): first -= evaluate_recursive_draft(expr[i]) return firstWhy does this recursive draft fail our constraints? CPython caps its function call stack at
sys.getrecursionlimit()frames —1000by default — and that1000-frame budget includes the test harness and caller frames already on the stack whenevaluate()is called. On a valid expression nested1000lists deep (["-", ["-", ...]]), plain recursion crashes withRecursionError: maximum recursion depth exceeded.Replace the call stack with an explicit Frame stack
Instead of relying on Python's C call stack, we manage our own
stackin a plain Pythonlist(which lives on the heap and is limited only by available RAM). Each entry onstackis a tinyFrameobject representing one currently open expression list along the path from the root down to the current sub-expression:Active expression path: Explicit `stack` (at most D frames): root: ["-", ..., ...] -> stack[0]: Frame(op="-", next_index=2, count=1, running=15) \ child: ["-", 6] -> stack[1]: Frame(op="-", next_index=2, count=1, running=6) <-- topTo keep every
FramestrictlyO(1)in memory: - Store a reference toexprplus an integer cursornext_index(starting at1), never slicingexpr[1:](which would copy up toNpointers). - Storerunning_value(the integer accumulated so far) andoperand_count(how many operands have been folded intorunning_value).Validate inputs and handle unary vs. multi-operand "-"
Tracking
operand_countinsideFramelets us unify all three"-"cases cleanly without peeking ahead:- In
__init__: rejectlen(expr) == 0,op not in OPERATORS, andop == "-" and len(expr) == 1(["-"]). NoticeOPERATORS = ("+", "-")is a tuple rather than asetordict: if someone passes an unhashable list in the operator slot like[["+"], 1], checkingop not in ("+", "-")compares with==and raises the requiredValueErrorinstead of crashing withTypeError: unhashable type: 'list'. - In
fold_operand(value):- For
"+", always addvaluetorunning_value(which starts at0, so["+"]naturally finishes at0). - For
"-", whenoperand_count == 0(the first operanda), setrunning_value = value(+a). For every later operand (operand_count >= 1), subtractvalue(running_value -= value), producing((a - b) - c).
- For
- In
finish(): once all operands are read, checkif self.op == "-" and self.operand_count == 1:. If only one operandawas ever folded, return-self.running_value(-a); otherwise returnself.running_valuedirectly.
OPERATORS = ("+", "-") def validate_integer(value) -> int: """Return value if it is a true Python int, or raise ValueError otherwise.""" # In Python, bool is a subclass of int (isinstance(True, int) is True), # so we must reject booleans explicitly before checking isinstance(value, int). if isinstance(value, bool) or not isinstance(value, int): raise ValueError(f"Operand must be an integer or expression list, got: {value!r}") return value class Frame: """State for one active expression list `[op, operand_1, ...]` on the evaluation stack. Mini-shape: Frame(expr_ref, op="+"|"-", next_index=1..len(expr), operand_count=0.., running_value=int) """ def __init__(self, expr: list): # Validate list-level syntax immediately when entering the sub-expression. if len(expr) == 0: raise ValueError("Expression list cannot be empty") op = expr[0] if op not in OPERATORS: raise ValueError(f"Unsupported operator: {op!r}") # "+" allows zero operands (["+"] == 0), whereas "-" requires at least one operand. if op == "-" and len(expr) == 1: raise ValueError("Operator '-' requires at least one operand") # Keep a reference to `expr` rather than slicing `expr[1:]` so frame space stays O(1). self.expr = expr self.op = op self.next_index = 1 # Index of the next unread operand inside `self.expr` self.operand_count = 0 # Number of evaluated operands folded so far self.running_value = 0 # Accumulator updated left-to-right as operands finish def has_more_operands(self) -> bool: return self.next_index < len(self.expr) def next_operand(self): operand = self.expr[self.next_index] self.next_index += 1 return operand def fold_operand(self, value: int) -> None: """Combine the next evaluated operand `value` into `self.running_value` left to right.""" if self.op == "+": self.running_value += value elif self.operand_count == 0: # For "-", the first operand seeds the accumulator (+a) so subsequent operands # compute ((a - b) - c) instead of subtracting `a` from 0. self.running_value = value else: self.running_value -= value self.operand_count += 1 def finish(self) -> int: """Produce the final integer value once all operands in `self.expr` have been folded.""" # Unary minus `["-", a]` seeded `running_value = a` with operand_count == 1; negate it here. # Binary/variadic minus (`operand_count >= 2`) already subtracted later operands from `a`. if self.op == "-" and self.operand_count == 1: return -self.running_value return self.running_value- In
Write the iterative evaluation loop
Now
evaluate(expr)handles a bare non-list input up front, then runs a simplewhile stack:loop looking atcurrent_frame = stack[-1]:- Still has unread operands (
current_frame.has_more_operands()): Read the next operand. If it is a nestedlist, push a newFrame(operand)ontostackso the child evaluates first whilecurrent_framewaits underneath. Otherwise validate that it is an integer and fold it directly intocurrent_frame. - No operands left: Finalize
sub_result = current_frame.finish()and popcurrent_frame. Ifstackis now empty,sub_resultis the answer for the whole expression; otherwise foldsub_resultinto the waiting parent framestack[-1].
from typing import Union def evaluate(expr: Union[int, list]) -> int: # Base case: a bare top-level token (e.g., `evaluate(7)`) skips the stack after validation. if not isinstance(expr, list): return validate_integer(expr) # Explicit call stack of active Frame objects along the current root-to-node path. # Using a Python list avoids CPython's ~1000-frame recursion limit while using O(D) space. stack = [Frame(expr)] while stack: current_frame = stack[-1] # Phase 1: If the top frame still has unread operands, advance by one operand. if current_frame.has_more_operands(): operand = current_frame.next_operand() if isinstance(operand, list): # Nested expression list: pause `current_frame` and evaluate the child first. stack.append(Frame(operand)) else: # Leaf operand: validate that it is a true int and fold it immediately. current_frame.fold_operand(validate_integer(operand)) # Phase 2: All operands of `current_frame` are done; finalize and pop it. else: sub_result = current_frame.finish() stack.pop() if not stack: return sub_result # Feed the completed sub-expression's integer value into its waiting parent frame. stack[-1].fold_operand(sub_result) # Unreachable because stack starts non-empty and returns when the root frame pops. raise AssertionError("Unreachable empty stack state")- Still has unread operands (
Trace Example 3 step by step on the stack
Let's trace
expr = ["-", ["+", 12, 3], ["-", 6], ["+"]](writing each frame asF(op, idx, count, val)):Step Action Stack (bottom -> top) ---- -------------------------------------------- ---------------------------------------------- 1 Start with root list [F("-", idx=1, count=0, val=0)] 2 Root reads ["+", 12, 3] -> push child [F("-", idx=2, count=0, val=0), F("+", idx=1, count=0, val=0)] 3 Child "+" folds 12, then folds 3 [F("-", idx=2, count=0, val=0), F("+", idx=3, count=2, val=15)] 4 Child "+" finishes -> 15; pop & fold into F0 [F("-", idx=2, count=1, val=15)] (first operand seeds +15) 5 Root reads ["-", 6] -> push child [F("-", idx=3, count=1, val=15), F("-", idx=1, count=0, val=0)] 6 Child "-" folds 6 [F("-", idx=3, count=1, val=15), F("-", idx=2, count=1, val=6)] 7 Child "-" finishes (count==1 -> -6); fold [F("-", idx=3, count=2, val=21)] (15 - (-6) = 21) 8 Root reads ["+"] -> push child, finish -> 0 [F("-", idx=4, count=3, val=21)] (21 - 0 = 21) 9 Root finishes (count==3 -> 21); stack empty return 21Notice
stacknever held more than2frames — matching the nesting depthD = 2— and no sub-list was ever copied.Complete solution
from typing import Union # Use a tuple rather than a set/dict for membership checks so unhashable elements # like a nested list in operator position (e.g., [["+"], 1]) compare cleanly with `==` # and raise ValueError instead of TypeError: unhashable type: 'list'. OPERATORS = ("+", "-") def validate_integer(value) -> int: """Return value if it is a true Python int, or raise ValueError otherwise.""" # In Python, bool is a subclass of int (isinstance(True, int) is True), # so we must reject booleans explicitly before checking isinstance(value, int). if isinstance(value, bool) or not isinstance(value, int): raise ValueError(f"Operand must be an integer or expression list, got: {value!r}") return value class Frame: """State for one active expression list `[op, operand_1, ...]` on the evaluation stack. Mini-shape: Frame(expr_ref, op="+"|"-", next_index=1..len(expr), operand_count=0.., running_value=int) """ def __init__(self, expr: list): # Validate list-level syntax immediately when entering the sub-expression. if len(expr) == 0: raise ValueError("Expression list cannot be empty") op = expr[0] if op not in OPERATORS: raise ValueError(f"Unsupported operator: {op!r}") # "+" allows zero operands (["+"] == 0), whereas "-" requires at least one operand. if op == "-" and len(expr) == 1: raise ValueError("Operator '-' requires at least one operand") # Keep a reference to `expr` rather than slicing `expr[1:]` so frame space stays O(1). self.expr = expr self.op = op self.next_index = 1 # Index of the next unread operand inside `self.expr` self.operand_count = 0 # Number of evaluated operands folded so far self.running_value = 0 # Accumulator updated left-to-right as operands finish def has_more_operands(self) -> bool: return self.next_index < len(self.expr) def next_operand(self): operand = self.expr[self.next_index] self.next_index += 1 return operand def fold_operand(self, value: int) -> None: """Combine the next evaluated operand `value` into `self.running_value` left to right.""" if self.op == "+": self.running_value += value elif self.operand_count == 0: # For "-", the first operand seeds the accumulator (+a) so subsequent operands # compute ((a - b) - c) instead of subtracting `a` from 0. self.running_value = value else: self.running_value -= value self.operand_count += 1 def finish(self) -> int: """Produce the final integer value once all operands in `self.expr` have been folded.""" # Unary minus `["-", a]` seeded `running_value = a` with operand_count == 1; negate it here. # Binary/variadic minus (`operand_count >= 2`) already subtracted later operands from `a`. if self.op == "-" and self.operand_count == 1: return -self.running_value return self.running_value def evaluate(expr: Union[int, list]) -> int: # Base case: a bare top-level token (e.g., `evaluate(7)`) skips the stack after validation. if not isinstance(expr, list): return validate_integer(expr) # Explicit call stack of active Frame objects along the current root-to-node path. # Using a Python list avoids CPython's ~1000-frame recursion limit while using O(D) space. stack = [Frame(expr)] while stack: current_frame = stack[-1] # Phase 1: If the top frame still has unread operands, advance by one operand. if current_frame.has_more_operands(): operand = current_frame.next_operand() if isinstance(operand, list): # Nested expression list: pause `current_frame` and evaluate the child first. stack.append(Frame(operand)) else: # Leaf operand: validate that it is a true int and fold it immediately. current_frame.fold_operand(validate_integer(operand)) # Phase 2: All operands of `current_frame` are done; finalize and pop it. else: sub_result = current_frame.finish() stack.pop() if not stack: return sub_result # Feed the completed sub-expression's integer value into its waiting parent frame. stack[-1].fold_operand(sub_result) # Unreachable because stack starts non-empty and returns when the root frame pops. raise AssertionError("Unreachable empty stack state")✅ Submit now — all tests should pass.
Intuition & how it works
Imagine evaluating nested parentheses using a stack of sticky notes on your desk. Each time you encounter a bracketed prefix expression (an expression where the operator appears first, like ["+", 12, 3]), you place a new sticky note on top of the pile recording the operator, which item index you are reading next, how many operands you have combined so far, and the running total. Whenever an inner list finishes all of its items, you tear off that top note and fold its single resulting number into the waiting note directly underneath.
Two obvious approaches fall short of the constraints here. Writing a standard recursive function hits CPython's default 1000-frame call-stack limit (RecursionError) on inputs nested 1000 levels deep, because the caller's own stack frames already consume part of those 1000 slots. Meanwhile, slicing sub-lists (expr[1:]) or collecting evaluated operands into a temporary list ([evaluate(x) for x in expr[1:]]) allocates up to O(N) extra memory on wide expressions like ["+", 1, 1, ..., 1], breaking the O(D) auxiliary space requirement.
Using an explicit Python list of tiny Frame objects (stack) solves both problems at once. Walk through ["-", ["+", 12, 3], ["-", 6], ["+"]]:
1. Push a root "-" frame. Its first operand is ["+", 12, 3], so push a "+" frame on top.
2. The "+" frame folds 12 and 3 into running_value = 15, pops, and hands 15 to the root "-" frame (since operand_count == 0, root sets running_value = 15, operand_count = 1).
3. Root's second operand is ["-", 6], so push a "-" frame. It folds 6 (operand_count = 1), sees operand_count == 1 in finish(), and negates 6 to return -6; root subtracts -6 (15 - (-6) = 21, operand_count = 2).
4. Root's third operand ["+"] pushes a "+" frame with zero operands that immediately finishes with 0; root folds 21 - 0 = 21 (operand_count = 3) and returns 21.
Complexity
- Time:
O(N), whereNis the total number of tokens (operators, integers, and sub-lists) across the entire nested structure. Every sub-list creates exactly oneFrameand is popped once, and every operand is read once bynext_operand()and folded inO(1)constant time without copying any list. (Even10^5maximal 32-bit integers sum to less than2^48, so integer arithmetic stays constant-time.) - Auxiliary space:
O(D), whereDis the maximum nesting depth. At any point,stackonly holds oneFrameper open list along the single active path from the root to the current element — never sibling lists that already finished — and eachFramestores only a pointer toexprplus four scalar fields (O(1)per frame).
Edge cases
- Bare top-level integer (or invalid top-level scalar):
evaluate(7)returns7directly without creating aFrame, whileevaluate(True),evaluate("5"), orevaluate(None)still runs throughvalidate_integerand raisesValueError. - Zero-operand
"+"vs. zero-operand"-":["+"]legally returns0(and["-", ["+"]]returns0), whereas["-"]raisesValueErroreven when buried deep inside a larger valid expression like["+", 1, ["-", 2, ["-"]]]. - Unary negation vs. left-associative subtraction:
["-", 6]returns-6, whereas["-", 25, 8, 4]evaluates left-to-right as(25 - 8) - 4 = 13(a left-associative operator groups from the left, not25 - (8 - 4) = 21). - Unhashable token in operator position: An input like
[["+"], 1]has alistatexpr[0]. Checkingop not in ("+", "-")against a tuple uses==and cleanly raisesValueError, whereasop not in {"+": ...}against adictorsetwould crash withTypeError: unhashable type: 'list'. - Python booleans (
True/False): Becauseboolsubclassesintin Python (isinstance(True, int)isTrue),validate_integerchecksisinstance(value, bool)first so["+", True, 1]raisesValueErrorinstead of silently returning2. - 32-bit integer overflow boundaries: Inputs fit in signed 32-bit integers (
-2^31to2^31 - 1), so["-", -2147483648](2147483648) and["+", 2147483647, 2147483647](4294967294) exceed 32 bits. Python's arbitrary-precisioninthandles this automatically; in C++ or Java you would use a 64-bitlongaccumulator. - Shared vs. cyclic list references: Reusing the same sub-list object twice (
sub = ["+", 1, 2]; evaluate(["+", sub, sub])) works fine (6). If untrusted Python callers could construct a self-referential cycle (a = ["+"]; a.append(a)), tracking activeid(expr)values in asetalongsidestack(O(D)space) catches cycles inO(1)per push.
Common mistakes
- Using plain recursion without checking Python's stack limit: Depth
1000exceeds CPython's default1000-frame call stack once test-runner frames are included, raisingRecursionError. - Collecting operand results into a list or slicing
expr[1:]: Allocating avalueslist or slicingexpr[1:]on["+", 1, 1, ..., 1]turnsO(D)extra space intoO(N)extra space (and slicing inside recursion can even turn time intoO(N^2)). - Subtracting the first operand from
0on multi-operand"-": Initializingacc = 0and runningacc -= valueon every operand turns["-", 25, 8, 4]into-25 - 8 - 4 = -37instead of(25 - 8) - 4 = 13. - Evaluating subtraction right-to-left: Computing
first - evaluate(["-"] + rest)evaluates25 - (8 - 4) = 21instead of(25 - 8) - 4 = 13. - Letting
IndexErrororTypeErrorleak out: Accessingexpr[0]before checkinglen(expr) == 0, or hashingexpr[0]in adictbefore checkingisinstance(op, str), raises the wrong exception type instead ofValueError.
Follow-up questions
-
How could you decouple operator rules from tree traversal so adding variadic operators such as
"*","/", or"max"requires no changes to the stack loop? Extract the operator-specific math out ofFrameinto anOperatorSpecregistry (REGISTRY: dict[str, OperatorSpec]), where each operator definesmin_operands,fold(acc, value, count) -> int, andfinish(acc, count) -> int. InFrame.__init__, first verifyisinstance(op, str) and op in REGISTRY(checkingisinstance(op, str)preventsTypeErroron unhashableexpr[0]) and verifylen(expr) - 1 >= spec.min_operands. The stack loop inevaluate()never changes at all when new operators are added:"*"setsmin_operands = 0(returning the multiplicative identity1whencount == 0),"max"setsmin_operands = 1and tracks the largest value seen, and"/"setsmin_operands = 2(or1if unary reciprocal1 // ais desired), specifies truncation vs. floor division explicitly, and raisesValueErrorif any divisor is0. -
What happens when expression nesting goes far beyond Python's call-stack limit (for instance, 100,000 levels deep), and how does an iterative evaluator handle it? Our
Frame-stack implementation is already purely iterative! Becausestackis a standard heap-allocated Pythonlistrather than the C call stack,10^5nested lists simply push10^5smallFrameobjects (~15–20 MB in CPython) without touchingsys.getrecursionlimit(). At depths above10^5, watch out for the surrounding infrastructure in production: built-in recursive serializers/parsers likejson.loads,repr(expr), orcopy.deepcopy(expr)will themselves hitRecursionErroron10^5-deep trees unless replaced with streaming/iterative parsers and a hard max-depth cap on untrusted requests. -
If short-circuiting logical operators such as
"AND"and"OR"were added, how would you skip evaluating unneeded sub-expressions? Short-circuit evaluation (stopping as soon as the final answer is determined, such as skipping the rest of"AND"once any operand evaluates toFalse) requires only a one-line hook inFrame: letfold_operand(value)return adone: boolflag (or advanceself.next_index = len(self.expr)) as soon as a deciding value arrives (Falsefor"AND",Truefor"OR"). Because our loop evaluates operands one at a time on demand rather than pre-evaluating all children, any remaining sub-lists inself.exprare never even pushed ontostack! One subtle product decision to clarify with your interviewer is error handling on skipped branches (for example,["AND", False, ["UNKNOWN_OP"]]): if malformed syntax in skipped branches must still raiseValueError, run a separate iterativeO(N)syntax-validation pass before evaluating; if full lazy evaluation (delaying computation of an expression until its value is actually needed, often wrapped in an unevaluated object called a thunk) is wanted, skipped branches intentionally stay untouched just like Python'sFalse and (1 / 0).
Alternative approaches
- Recursion with
O(1)per-call accumulators: Clean and ~25 lines shorter when max depth is guaranteed well below1000(sayD <= 500), since each call frame holds onlyop, loop indexi, andrunning_value, but fails atD = 1000under CPython's default stack limit unlesssys.setrecursionlimitis mutated globally. - Lightweight
[expr, next_index, count, running_value]list tuples instead of aFrameclass: Uses the exact same iterative algorithm with slightly lower per-frame object overhead in Python, at the cost of less self-documenting code (frame[3]instead offrame.running_value).
Follow-up questions
- How could you decouple operator rules from tree traversal so adding variadic operators such as "*", "/", or "max" requires no changes to the stack loop?
- What happens when expression nesting goes far beyond Python's call-stack limit (for instance, 100,000 levels deep), and how does an iterative evaluator handle it?
- If short-circuiting logical operators such as "AND" and "OR" were added, how would you skip evaluating unneeded sub-expressions?
Similar questions
- In-Memory Exact Suffix Query Index
- Identify Unreferenced Heap Allocations From Stack Roots
- Identify Unreachable Heap Allocations
- Optimal Revenue From Rod Cutting
- Debugging Browser Memory Leaks in a Long-Running Web Console
- Hash Table Collision Strategies and Performance
More Anduril interview questions
- In-Memory Exact Suffix Query Index Medium
- Debugging Browser Memory Leaks in a Long-Running Web Console Medium
- Hash Table Collision Strategies and Performance Medium Pro
- Identify Unreferenced Heap Allocations From Stack Roots Medium Pro
- Identify Unreachable Heap Allocations Medium Pro
- Optimal Revenue From Rod Cutting Medium Pro