Recursion Interview Questions
113 interview questions in our bank cover Recursion, most of them Coding Questions. They average 3.0/5 difficulty β medium β and each one was reported by a candidate after a real interview. Companies known to ask about Recursion: Amazon, Google, Snowflake, Uber, Meta, and 15 more.
Practice these on the problems board βCompanies that ask about Recursion
Question mix
- Coding Questions112
- Behavioral1
Difficulty
- 2/5 β easy21
- 3/5 β medium76
- 4/5 β hard16
Recursion questions at Amazon
Regex Matching With Grouped Stars
4/5This Amazon interview puzzle requires you to build a custom pattern matching engine that extends traditional wildcard rules to support repeated multi-character blocks. You must parse specialized expressions containing grouped sequences and repetition tokens to validate text integrity efficiently. The evaluation focuses on your ability to handle complex state transitions, string parsing, and recursive or dynamic programming approaches. Unlocking the full problem guidelines, edge cases, and the comprehensive model solution requires a subscription.
Coding QuestionsAmazonNested List Weight Sum
2/5This frequently asked Amazon interview question challenges you to process hierarchically structured numerical data. You must compute a depth-weighted total by multiplying each embedded value by its specific level of nesting. The task is an excellent exercise for testing recursion, tree traversal, and depth-tracking algorithms. Unlock the complete problem statement and optimal model solution with a paid subscription.
Coding QuestionsAmazonMinimum Cost with Bundles/Offers
3/5A coding question about buying an exact shopping list at the lowest price when repeatable bundle deals compete with unit prices. No bundle may push any item past the quantity required.
Coding QuestionsAmazonOrg-Chart Salary Aggregation
3/5A coding question on aggregating salaries over a management hierarchy. It asks for the manager with the best-paid direct team, then for the average pay across a whole reporting chain below a chosen person. A subscription is needed to see the full statement and a model solution.
Coding QuestionsAmazonRecursive JSON-like Schema Validation
3/5This algorithmic problem, featured in Amazon technical interviews, requires building a robust recursive validation engine that checks whether arbitrary nested data structures conform to predefined hierarchical rules. Candidates must demonstrate proficiency in tree traversal, type checking, and handling complex composite objects and collections. This exercise tests your ability to write clean, defensive parsing logic for deeply nested payloads. Access the complete problem description and optimal model solution by acquiring a subscription.
Coding QuestionsAmazonRetrieve Concrete Items From a Nested Box
3/5Navigating hierarchical data structures is a fundamental computer science competency, frequently tested in coding evaluations at companies like Amazon. This task requires you to traverse nested container definitions, resolve references, and extract all primitive elements contained within a specified target. You will need to design an approach that handles recursive nesting and delivers a cleanly ordered output. Practicing this scenario strengthens your recursive traversal and tree-handling abilities. Unlocking the full problem specification and reference implementation requires an active subscription.
Coding QuestionsAmazonRecursive JSON Schema Validator
3/5This Amazon onsite coding challenge tests your object-oriented design and recursive parsing skills by asking you to build a custom validator for hierarchical data structures against a defined specification. You must handle various data types, optional properties, nested lists, and missing fields while producing informative error paths when validation fails. It is an excellent test of robust edge-case management and clean code architecture. Access to the complete problem specifications and the verified implementation requires a subscription.
Coding QuestionsAmazonDecode Morse With Word Separator β All Decodings
3/5This intricate parsing problem, documented in software engineering interviews at Amazon, involves translating a continuous sequence of dot and dash signals into valid textual sentences using a provided dictionary and designated word delimiters. Because individual segments lack internal character boundaries, multiple interpretations are often possible, requiring you to generate and sort every uniquely decodable message. The task evaluates advanced string manipulation, recursion, and backtracking strategies to handle combinatorial explosion. Unlock the full problem context and an optimal model solution with a subscription.
Coding QuestionsAmazonRegular Expression Matching
4/5Tackle a legendary string processing interview question commonly asked at Amazon, where you must determine if a text string matches a pattern containing wildcard symbols and repetition operators. This problem evaluates your command of dynamic programming and recursive state evaluation to handle ambiguous matching rules efficiently. Successfully solving it requires careful edge-case handling for zero-or-more occurrences and single-character placeholders. The comprehensive problem walkthrough and expert solution are available exclusively to subscribers.
Coding QuestionsAmazonLexicographically Largest Identifier
3/5A coding question about building an identifier from a lowercase string by repeatedly taking one letter and discarding everything on one side of it. The learner returns the largest identifier in dictionary order that the process can produce, for strings up to one hundred thousand letters.
Coding QuestionsAmazonGet Nested Object Value by Path String
3/5A coding question on reading a value deep inside nested dictionaries and lists from a single text path that mixes names and positions. It covers parsing the path, handling missing or mismatched steps with a fallback value, and rejecting badly formed input.
Coding QuestionsAmazon
Recursion questions at Google
Enumerate All Strings of 1s and 2s with a Given Digit Sum
2/5A coding question about generating every sequence built from two small symbols that meets an exact total, then reasoning about how large the result can get. It tests recursive enumeration, ordering of the output, and how to size the work by what is produced rather than by what is searched.
Coding QuestionsGoogleCompute Total Size of a File System
2/5A coding question about adding up the space used by every file in a nested directory tree. It asks for two versions of the same function, one of which must cope with directories nested far deeper than a call stack allows.
Coding QuestionsGoogleDepth-First Search on a Colored Graph
3/5A coding question on walking a directed graph from a start node, reporting the visiting order and whether a loop is reachable, including very long paths and missing nodes.
Coding QuestionsGoogleLongest Step-by-One Chain in a Tree
3/5A coding question on binary trees: report the longest chain of linked nodes whose values rise by exactly one at each step. It first asks only for parent-to-child chains and then for chains that may go up and change direction at a node.
Coding QuestionsGoogleImplement deleteDirectory in a Virtual File System
3/5This Google interview question places you inside a simulated directory architecture where you must manage hierarchical nodes and recursive cleanups. You are tasked with implementing directory removal logic that safely dismantles nested folders and eliminates all enclosed files without leaving orphan references. The problem evaluates your familiarity with tree-like structures, recursive traversal patterns, and memory management concepts in virtualized environments. Discover the complete problem statement and professional solution code with a subscription.
Coding QuestionsGoogleFence Painting Minimum Operations
3/5Reported from a Google coding interview, this challenge asks you to determine the minimum number of paint-roller operations needed to color a series of adjacent fence planks of varying heights. You can apply vertical strokes to individual planks or horizontal strokes across contiguous blocks, with each stroke carrying a fixed cost. The problem evaluates your greedy or dynamic programming skills to find the most efficient overlapping stroke strategy. Unlock the full problem details, complexity analysis, and model solution with a subscription.
Coding QuestionsGoogleEvaluate a Nested Math Expression
3/5A coding question on parsing and evaluating nested arithmetic function calls from a string. It covers the exact grammar, argument order, negative values, whitespace and invalid input, and expects the parser to cope with very deep nesting.
Coding QuestionsGoogleExpression Add Operators to Reach Target
4/5Featured frequently in Google coding assessments, this algorithmic puzzle challenges you to insert mathematical operations between sequential digits to match a desired numerical target. Success requires navigating recursive state spaces and managing operator precedence constraints without violating formatting rules. Gain full access to the comprehensive solution and step-by-step code walkthrough with a subscription.
Coding QuestionsGoogleString Decompression with Nested Counts
3/5A coding question on expanding a compact string notation where bracketed groups carry a repeat count and may contain further groups. The task is to rebuild the full text while keeping the surrounding plain characters in place.
Coding QuestionsGoogleCheck Whether a Mahjong Hand Is Winning
3/5A coding question on deciding whether a hand of numbered tiles can be fully divided into one matching pair and four groups, each group being either three equal tiles or three consecutive tiles of one suit.
Coding QuestionsGoogle
Recursion questions at Snowflake
N-Queens
4/5A coding question about the classic chessboard puzzle of placing queens so that none can capture another. Given the board size, the candidate must return every valid arrangement as a list of board rows, and handle sizes that have no arrangement at all.
Coding QuestionsSnowflakeString-Command Stream Calculator
3/5A coding question on evaluating a list of arithmetic commands against a running value, including commands whose operand is itself a list of commands. It tests recursion, careful input handling and clear error behaviour.
Coding QuestionsSnowflakeTree Node Deletion β Max Height
3/5Hierarchical data manipulation is a key theme in advanced algorithmic interviews, as demonstrated by this Snowflake tree modification challenge. Given an N-ary tree and a set of nodes targeted for removal, you must compute the maximum resulting height after bypassing deleted nodes and rerouting their descendants. This problem evaluates your depth-first search techniques, tree pointer restructuring, and recursive height calculations. To review the entire problem specification along with the step-by-step solution, a subscription is needed.
Coding QuestionsSnowflakeLongest Path of Equal Values in a Binary Tree
3/5A coding question about a binary tree given as a level-order list. The learner finds the length, in edges, of the longest path whose nodes all hold the same value, wherever that path starts and ends.
Coding QuestionsSnowflakeTwo Encoded Strings Describe the Same Original
4/5A string question on compressed text: letters stand for themselves and numbers stand for runs of unknown characters, with digit runs that can be read in several ways. The learner must decide whether two compressed strings could describe one original string.
Coding QuestionsSnowflakePre-order Traversal Skipping Invalid Nodes
2/5This Snowflake interview question asks you to implement a modified pre-order tree traversal that handles disconnected or skipped nodes. You will need to process hierarchical data where specific elements are marked as inactive, ensuring that their descendants are still visited in the correct sequence through their nearest active ancestors. This exercise tests your recursive depth-first search logic and ability to manipulate parent-child relationships efficiently. Unlock the full problem description and complete model solution with a subscription.
Coding QuestionsSnowflakeWord Search in a 2-D Grid
3/5This Snowflake interview question evaluates your ability to navigate a character matrix along contiguous horizontal and vertical paths to locate a specific sequence. Candidates must demonstrate proficiency in backtracking and graph traversal techniques to efficiently check possible routes without reusing identical grid positions. Access to the comprehensive problem description and optimal algorithmic implementation requires a subscription.
Coding QuestionsSnowflakeRewrite Second Tree With Subtree Sums
2/5A coding question on binary trees: given two trees of the same shape, fill the second so that each node holds a total taken from the first. It checks in-place updates, very deep inputs and a discussion of sharing the work across a fixed number of workers.
Coding QuestionsSnowflakeSplice Two Sorted Linked Lists
2/5A coding question on joining two ordered chains of linked nodes into one ordered chain by relinking the existing nodes. It checks empty inputs, equal values from both chains, and that no node is copied or lost.
Coding QuestionsSnowflake
Recursion questions at Uber
Binary Tree Longest Consecutive Sequence II
3/5Discover how to determine the longest unbroken sequence of adjacent values that differ by one within a hierarchical tree structure. Reported as an interview challenge at Uber, this problem evaluates your grasp of tree traversal techniques, recursive state management, and bidirectional path tracking. Candidates must handle both ascending and upward-downward transitions smoothly. Unlock the full problem description, algorithmic walkthrough, and optimal code implementation by upgrading to a paid subscription.
Coding QuestionsUberDeepest Shared Ancestor of Two Nodes in a Binary Tree
3/5A binary tree coding question: given a tree in level order and two of its values, return the deepest node that has both of them below it or is one of them. It checks handling of the case where one target sits above the other, input with missing children, and very deep trees.
Coding QuestionsUberLetter Combinations of a Phone Number
3/5Practice this classic Uber interview question that requires generating all possible letter sequences corresponding to a sequence of numeric keypad digits. You will translate phone button mappings into combinations through systematic exploration and tree generation. The problem tests your recursive backtracking skills and invites comparative analysis with iterative generation strategies. Unlock the comprehensive challenge guidelines and a verified code solution by subscribing.
Coding QuestionsUberNested Add/Sub Expression Evaluator
3/5A coding question on reading a text expression made of function-style addition and subtraction calls that may contain one another, and returning its numeric value, including negative numbers and irregular spacing.
Coding QuestionsUberTennis Tournament: Play the Rounds and Seed the Bracket
3/5A coding question about a knockout tennis tournament: play out a given draw round by round with exact printed output, then produce a fair draw for any number of players so the strongest meet as late as possible.
Coding QuestionsUberCompress a Binary Grid into a Region Tree and Rebuild It
3/5A coding question on turning a square image of 0s and 1s into a compact tree of uniform square regions, then rebuilding the image from that tree. It checks the exact node layout and the order of the four quarters.
Coding QuestionsUberCompare Two Structs / Classes for Equality
3/5A coding question on writing a general equality check for nested data and user-defined objects. It covers type strictness, floating-point tolerance, unordered versus ordered containers, and structures that refer back to themselves.
Coding QuestionsUber
Recursion questions at Meta
Count Good Nodes in Binary Tree Based on Root Path Values
2/5Count the nodes of a binary tree whose value is at least as large as every value on the path down from the root. This Meta question is a traversal that carries context: the running maximum along the current path is the only state needed, and it must be passed down rather than kept globally. You will update that maximum as you descend, count on the way, and handle negative values without a special case. Subscribers get the complete problem and the model solution.
Coding QuestionsMetaGenerate All Subsets (Power Set) of {'a', 'b', 'c'}
2/5Produce every subset of a small set of characters, including the empty one, with each combination appearing exactly once. This Meta warm-up has two standard answers worth being able to switch between: recursive include-or-exclude branching, and iterating over bitmasks. You will avoid duplicates, decide on an output order, and explain why the result count is exponential in the input size. Subscribers get the complete problem and the reference solution.
Coding QuestionsMetaFast Power and Modular Power
3/5A coding question on raising a number to an integer power, including negative exponents, when the exponent can be in the billions. A follow-up asks for the same computation on integers modulo a given value, with exponents as large as ten to the eighteenth.
Coding QuestionsMetaLowest Common Ancestor in Ordered and Unordered Binary Trees
3/5A coding question about finding the closest shared ancestor of two nodes, first in an ordered tree and then in an unordered one, with discussion variations on missing nodes and other tree shapes. It checks edge cases such as one node sitting above the other, repeated values and very deep trees.
Coding QuestionsMetaLongest Path in a Tree
3/5A coding question about finding the greatest distance between any two nodes of a tree given as an edge list. The tree can be very deep and very large, so the solution has to avoid both deep recursion and repeated work.
Coding QuestionsMeta
Recursion questions at Apple
Tower of Hanoi (recursion)
3/5Report the fewest moves needed to shift a stack of graded disks onto another peg without ever resting a larger disk on a smaller one. This Apple question has a closed-form answer and a recursive derivation, and the interviewer usually wants both. You will state the recurrence, reduce it to a formula, and note where the result stops fitting in a machine integer as the disk count grows. Subscribers can read the complete problem and the full derivation.
Coding QuestionsAppleExpand a Nested Repeat Encoding
3/5A coding question on turning a compact text notation, where counted groups can sit inside other groups, back into its full written-out form. The learner must handle multi-digit counts and any nesting depth.
Coding QuestionsAppleAll Orderings of Distinct Integers
3/5A coding question on producing every possible arrangement of a small list of distinct integers. It checks that each arrangement appears exactly once, that the empty input is handled, and that the caller's list is left unchanged.
Coding QuestionsAppleCombinatorial Product Selection
3/5A coding question on listing every basket that takes exactly one product from each category, in a fixed order, and on reasoning about how many baskets there are and what producing them costs.
Coding QuestionsApple
Recursion questions at OpenAI
Distributed Machine Cluster Count and Topology
3/5Discover facts about a cluster of machines arranged as a tree, where each machine can only pass messages to its immediate parent and children. Asked at OpenAI, the difficulty is that sends are asynchronous, delivery order is not guaranteed, and messages can arrive more than once. You will design a request-and-aggregate protocol over that unreliable channel, make handlers idempotent, and decide how a node knows its subtree has finished reporting. A subscription unlocks the full problem and the complete protocol design.
Coding QuestionsOpenAIResumable Iterator with Multi-Dimensional Support
3/5Build iterators that can be paused, serialised, and resumed from exactly where they stopped, first over a flat list and then over two- and three-dimensional data. This OpenAI round is a test-driven design exercise: the position itself becomes a value you have to define, store, and validate. You will decide what a resume token contains, keep nested dimensions consistent, and defend the interface against a token from a different dataset. The full problem and the reference design require a paid subscription.
Coding QuestionsOpenAIOpenSheet: Spreadsheet with Cell Dependencies
3/5In this coding interview question reported at OpenAI, you are asked to build a mini spreadsheet application that manages cell references, mathematical formulas, and automatic dependency updates. The challenge requires handling arithmetic operations while detecting and preventing circular references among cell links, with follow-ups exploring optimized evaluation graphs. It tests your graph traversal algorithms, state management, and object-oriented design capabilities. Access to the complete problem breakdown and verified model solution requires a subscription.
Coding QuestionsOpenAI
Recursion questions at Databricks
Reconstruct a Binary Tree from Inorder Traversal (Follow-up)
3/5Explain why one traversal order alone cannot pin down a binary tree, and say what extra information would make the reconstruction unique. This Databricks follow-up is a discussion question with a precise answer: the in-order sequence fixes the left-to-right arrangement but not the shape, and a second traversal or a structural marker resolves it. You will produce a counterexample, then describe the reconstruction once the extra information is available. Subscribers get the complete problem and the full discussion.
Coding QuestionsDatabricksPath Between Nodes in a Fibonacci Tree
4/5A coding question on a recursively defined binary tree that is far too large to store. Candidates return the list of node labels between two given nodes, in a fixed direction, from the tree's order and the labels alone.
Coding QuestionsDatabricksFile System Encryption Count and Minimum-Cost Encryption
2/5A coding question on a tree of files and folders: first tally the files by state, then choose the cheapest mix of per-file and per-folder operations that leaves every file in the desired state. It covers tree traversal and cost trade-offs on nested structures.
Coding QuestionsDatabricks
More Recursion questions
Sudoku validator and solver
2/5A classic grid puzzle in two parts: first decide whether a partly filled 9 by 9 board breaks any row, column or box rule, then complete it or report that no completion exists. Many boards have several answers, so a good solution is judged on legality and on keeping the given digits, not on one fixed grid.
Coding QuestionsConfluentValidate Brackets & Parse Nested Rich Text
3/5Master a two-part text manipulation challenge commonly featured in engineering evaluations at Figma. The first phase evaluates your ability to verify structural correctness in character sequences containing paired delimiters, while the second phase requires transforming hierarchical syntax into nested collection formats. This problem tests fundamental concepts in recursion and linear data structures. To view the full problem statement, detailed explanations, and complete model solution, a paid subscription is required.
Coding QuestionsFigmaCombinations Summing to a Target with Reusable Numbers
3/5A coding question on enumerating every way to reach a total using numbers that can be reused. It tests organising a search so each combination appears once and hopeless branches are cut early.
Coding QuestionsIMC TradingDelete a File System Subtree with Limited APIs
3/5This file system manipulation puzzle, featured in Datadog interviews, tasks developers with deleting an entire directory subtree using a severely restricted set of immutable application programming interfaces. Because deletion rules prevent removing non-empty directories directly, candidates must devise a reliable traversal strategy to clean up nested paths safely. This problem evaluates recursive problem-solving skills and meticulous edge-case handling within hierarchical structures. Gain immediate access to the full problem breakdown and expert solution with a subscription.
Coding QuestionsDatadogValidate Binary Search Tree
3/5Explore how to analyze hierarchical tree structures to verify adherence to strict ordering rules, a classic graph traversal challenge frequently featured in technical evaluations at Pinduoduo. This exercise assesses your ability to recursively or iteratively enforce boundaries across descendant nodes while handling edge cases cleanly. Sharpen your algorithmic thinking for validating relational hierarchies efficiently. Access to the comprehensive problem description, optimal strategies, and complete code solutions requires a platform subscription.
Coding QuestionsPinduoduoString Transformation Length
3/5This MathWorks coding challenge explores string manipulation and sequence scaling over multiple generation rounds. You are tasked with determining the final length of a text after applying a deterministic alphabet shift repeatedly, where specific characters expand into multiple new letters. The puzzle evaluates your skill in recognizing exponential growth patterns and utilizing recurrence or dynamic programming to avoid time-out errors. Unlocking the complete problem description and optimal source code requires an active subscription.
Coding QuestionsMathWorksInvert Binary Tree
2/5Mirror a binary tree so that every node's children swap sides, and return the same root. This Microsoft warm-up is three lines recursively and is asked to check that you recurse before or after the swap consistently, and that you handle a missing child without a special case. You will choose between recursion and an explicit queue, note the depth cost of each, and confirm the tree is modified rather than copied. A subscription unlocks the complete problem and the reference solution.
Coding QuestionsMicrosoftNested Todo List
3/5Reported during Notion interview loops, this problem asks candidates to build a hierarchical task manager capable of handling nested structures and completion states. The exercise evaluates tree manipulation, efficient node lookup, and state mutation within a forest data model. Developers must carefully manage parent-child relationships and sequential updates. To unlock the complete problem specifications and model solution, a subscription is required.
Coding QuestionsNotionEnumerate All Games of 4x4 Three-in-a-Row
3/5This Decagon interview question explores combinatorial game theory by asking you to enumerate all valid move sequences for a restricted board game variant. The challenge assesses your skills in recursive backtracking, state space search, and efficient termination tracking under custom winning conditions. You will need to handle deep branching factors while avoiding redundant state evaluations. Access the full problem details and algorithmic solution by purchasing a subscription.
Coding QuestionsDecagonFlatten a Nested List
2/5A coding question on nested lists of mixed values: produce one flat list in the original left-to-right order, handling empty sublists and any nesting depth, without a built-in flattening helper.
Coding QuestionsElasticGood Binary Strings
4/5This BNP Paribas interview challenge requires examining specific characteristics of binary sequences based on balance and prefix constraints. Candidates are tested on their ability to manipulate strings and evaluate structural validity efficiently. The task evaluates foundational algorithmic thinking and combinatorial reasoning. Access to the complete problem breakdown and the optimized reference solution requires an active subscription.
Coding QuestionsBNP ParibasGenerate Parentheses
3/5Practice this popular interview question reported at Disney, where you must systematically construct all well-formed sequences of paired symbols for a given count. The objective is to generate combinations that adhere strictly to nesting rules and maintain proper balance from start to finish. This problem is excellent for building recursion and backtracking skills. The complete problem guide and reference solution require a active subscription.
Coding QuestionsDisneyPow(x, n) β Fast Power with Negative Exponents
3/5A coding question on computing a real number raised to an integer power that may be negative or very large, without a built-in power function. It checks how you meet a strict running-time bound, handle reciprocals and signs, and reason about floating-point precision.
Coding QuestionsWeRideChain of Command
3/5Explore this organizational hierarchy challenge reported during interviews at IMC Trading. The task involves navigating a corporate tree structure to determine which employee receives a directive based on a specific propagation sequence and query parameter. This exercise tests your ability to handle tree traversal, parent-child relationships, and efficient indexing strategies. Access to the comprehensive problem statement and verified model solution requires a subscription.
Coding QuestionsIMC TradingPrint Directory Tree Given a File Path
3/5This Adobe interview challenge asks developers to traverse a nested data structure representing a hierarchical file system and output a visually formatted tree of directories and files. The task evaluates recursion, string manipulation, and error handling for missing or unexpected path types. Building a clean, indented visual representation tests fundamental tree traversal skills under structured constraints. Unlock the full problem description and expert reference solution by subscribing today.
Coding QuestionsAdobeBinary Tree Maximum Path Sum (Tree Kadane)
4/5Featured frequently in Adobe technical rounds, this tree-based challenge requires finding the maximum possible sum along any continuous path within a binary tree where nodes can hold negative integers. Unlike traditional root-to-leaf traversals, the path can start and end at arbitrary nodes, demanding a dynamic programming approach akin to Kadane's algorithm adapted for hierarchical structures. This problem thoroughly tests your recursion, tree manipulation, and optimal substructure identification skills. Get full access to the problem description and expert solution with a subscription.
Coding QuestionsAdobeJSON Path Query with Wildcards / Inverted Index
3/5This reported Netflix interview challenge requires you to build a custom query parser for navigating nested structured data using dot notation and wildcard matching. You will implement traversal logic to extract targeted values efficiently while handling missing keys gracefully. This problem evaluates your string manipulation capabilities, recursive thinking, and data structure navigation skills under interview conditions. Access to the complete problem breakdown and verified reference solution is available exclusively to subscribers.
Coding QuestionsNetflixDesign a Spreadsheet with Dependent Cells (set_cell / get_cell)
3/5Encountered in Character AI interview processes, this design challenge requires building a lightweight spreadsheet system capable of handling dynamic cell relationships and automatic updates. You must implement mechanisms to assign static values, establish parent-child dependencies, and recursively compute aggregated results when data changes. This problem tests your expertise in graph modeling, caching strategies, and state propagation in an object-oriented design. Unlocking the complete problem specification and reference solution requires an active subscription.
Coding QuestionsCharacter AIMenu Tree Diff β Count Changed Nodes
3/5A coding question on comparing two versions of a hierarchical menu and counting the items that changed, were removed or were added. It tests careful reading of how identity is defined, subtree counting and handling very deep inputs.
Coding QuestionsDoorDashComment System Formatting
3/5This interview question, frequently asked at Nextdoor, challenges candidates to format and display hierarchical data structures with proper indentation levels. The task tests your ability to handle tree-like relationships, parse parent-child identifiers, and manage missing nodes by leaving empty placeholders while preserving the structure of subsequent descendants. You will need to implement an efficient traversal algorithm that correctly orders the elements. Unlock the complete problem description and an optimal model solution by acquiring a subscription.
Coding QuestionsNextdoorSingle-Pass S-Expression Parser with Error Positions
3/5Build a hand-written parser for a Lisp-like syntax of numbers, names and nested parentheses, scanning the text once. The hard part is precise error reporting: which mistake is found first, and at which index. A last stage pushes nesting far past the interpreter's recursion limit.
Coding QuestionsBasetenCount Invalid Nodes in a Binary Search Tree
3/5A binary tree coding question: given a tree in level order that is meant to be a binary search tree, count how many children break the ordering rule relative to the node directly above them. It checks careful reading of the ordering rule, tree input with missing children, and very deep trees.
Coding QuestionsAppLovinBest Bending Path Sum in a Binary Tree
4/5A coding question on binary trees whose node values may be negative: find the largest total along any chain of connected nodes, then return the values on one such chain in order. Trees can be large and deeply unbalanced.
Coding QuestionsByteDanceFlatten / Unflatten Nested Python Structure
3/5Navigating arbitrarily nested hierarchies is a common hurdle in data processing interviews, as reported from recent xAI hiring loops. This exercise challenges candidates to recursively traverse mixed collections of dictionaries, lists, and tuples to linearize elements into a sequential format, and subsequently reconstruct the original shape using updated leaf values. It evaluates recursion depth management, structural awareness, and data parsing skills. Access the complete problem description, step-by-step guidance, and fully tested solution code with a subscription.
Coding QuestionsxAIEnumerate All Tic-Tac-Toe Games from a Board
3/5A coding question about generating every valid completion of a small two-player board game. It tests precise handling of alternating turns, terminal outcomes, move ordering, and complete result construction.
Coding QuestionsIvoRemove Subtrees Below a Threshold
2/5A coding question on cleaning up an ordered tree: every value under a given cutoff must go, together with everything hanging beneath it, and the remaining tree is returned. Reading the removal rule precisely matters, because it differs from keeping the still-valid descendants.
Coding QuestionsPayPalFilter Nested Comments β Keep Matched Nodes and Descendants
3/5Tackle this Bobyard technical screening question centered around hierarchical tree filtering and traversal. Given a nested discussion forest and a specific match condition, you need to prune the structure so that any matching nodeβalong with its entire subtree of descendantsβis preserved while unrelated branches are discarded. This challenge tests your recursive programming abilities, tree manipulation techniques, and optimization strategies for linear time complexity. Unlock the complete problem details and model solution with a subscription.
Coding QuestionsBobyardDot-and-Star Pattern Matching
4/5A coding question on writing a matcher for patterns with a single-character wildcard and a repeat symbol, where the pattern has to describe the entire string. It tests careful case analysis, empty strings and partial-match traps, all without a regular-expression library.
Coding QuestionsCitadelCount Divisible Permutations
3/5A coding question about counting arrangements of the numbers 1 to n in which every number and its position are related by divisibility. The learner must return the exact count for n up to 15.
Coding QuestionsDeloitteLeft-to-Right Expression Operators
3/5Given a string of digits and a target number, list every way to place plus, minus and times signs between the digits so the expression equals the target. Evaluation ignores normal operator priority, and operands may not carry leading zeros.
Coding QuestionsPinterestFlatten Nested JSON / HashMap to String
3/5This technical coding challenge commonly seen at Salesforce examines your ability to manipulate hierarchical structures using recursion or iterative traversal. You are asked to transform a deeply nested associative structure into a single-level layout utilizing dot-separated keys for leaf elements. This tests your proficiency in handling diverse data types, managing recursive base cases, and restructuring complex information cleanly. Unlock the full problem details and optimal algorithmic solution with our comprehensive subscription.
Coding QuestionsSalesforceRoot-to-Leaf Path Sum and All Matching Paths
3/5Given a binary tree and a target number, decide whether a route from the top node down to an end node adds up to that number, and list every route that does. The task checks careful handling of end nodes, negative values and recorded copies of partial results. Subscribers can see the full statement, constraints and model solution.
Coding QuestionsHudson River TradingImplement Nested Comments Feature for a Comment System
2/5In this Bobyard reported interview question, you must transform a flat collection of comment records into a hierarchical structure where individual responses correctly nest beneath their corresponding parent items. The task requires building a recursive or pointer-based grouping function that efficiently handles multiple levels of depth using unique identifiers. It tests your data organization abilities and proficiency with hierarchical JSON payloads. Access to the complete problem breakdown and expert model solution requires an active subscription.
Coding QuestionsBobyardConvert a BST to a Sorted Circular Doubly Linked List
3/5A pointer-manipulation question on trees: rearrange the nodes of a binary search tree into an ordered ring that can be walked in both directions, without creating new nodes. A follow-up asks how to keep the ring ordered as values are added, and the edge cases include empty and single-node trees.
Coding QuestionsPinterestCount Subtrees with Height-Diff <= 1 and Even Sum
3/5Count the subtrees of a binary tree that pass two checks at once: the heights of their two sides differ by at most one, and the values inside add up to an even number. The task asks you to reason about each node together with everything below it. The full problem and model solution require a subscription.
Coding QuestionseBayTree Preorder Merge
2/5Two binary trees are overlaid so that coinciding nodes add their values and lone nodes carry over. The task is to report the combined tree's values in root, left, right order.
Coding QuestionsHudson River TradingFlatten Nested Child Lists in a Doubly Linked List
3/5Merge the nested child lists of a doubly linked list into one level in place, in a fixed traversal order, keeping every back-pointer correct. The input can be very deeply nested.
Coding QuestionsBloombergBoolean Rule Parser and Evaluator
4/5Building a custom parser and evaluator for logical expressions is a sophisticated challenge reported during technical interviews at Stripe. Candidates must interpret complex conditional strings containing logical operators, nested parentheses, and comparison rules against a dynamic runtime context, respecting strict operator precedence and missing variable handling. This problem tests your compiler design skills, recursive descent parsing techniques, and evaluation logic. Access the detailed problem breakdown, syntax parsing strategies, and complete model implementation by obtaining a subscription.
Coding QuestionsStripeDecode Morse Code to All Possible Original Strings
3/5Given a string of dots and dashes with no letter separators and a letter-to-Morse mapping, list every letter string that encodes to exactly that signal. Because letter codes can be prefixes of one another, a signal may decode several ways, or none.
Coding QuestionsOscar HealthArithmetic Expression Evaluator with Parentheses
4/5Evaluate a text arithmetic expression that mixes the four basic operators with nested parentheses and returns an integer. The learner must respect precedence, left-to-right ties and truncating division, including on negative intermediate values.
Coding QuestionsRoktExpand Nested Repeat Encoding
3/5A string-parsing problem about turning a compact repeat notation with nested groups back into its full text. It checks care with multi-digit counts and with keeping each nesting level separate.
Coding QuestionsOracleBasic Calculator with Operators, Variables, and Functions
3/5This reported Tesla interview question challenges you to build a comprehensive expression parser that starts with basic arithmetic and progressively incorporates advanced features such as exponentiation, grouping symbols, logical operators, variable assignments, and custom routines. This puzzle evaluates your ability to design robust interpreters and handle complex grammar rules efficiently. To explore the complete problem statement, comprehensive test cases, and an optimized reference solution, a subscription is required.
Coding QuestionsTeslaPrint Comments Hierarchically by Parent-Child Relationship
2/5In this engaging coding exercise reported during Nextdoor interviews, engineers are tasked with organizing a flat collection of user remarks into a structured, tree-like hierarchy based on parent-child identifier relationships. The primary objective is to render these discussion threads correctly indented and sequentially ordered in the output. This challenge evaluates your proficiency in graph traversal, recursive thinking, and efficient data structuring using mapping techniques. To view the complete problem statement, detailed constraints, and a robust reference implementation, a paid subscription is required.
Coding QuestionsNextdoorCalculate Total Size of Files in Nested Directories
2/5Explore how to traverse hierarchical file systems and compute cumulative byte counts in this Datadog interview question. Candidates will practice handling recursive data structures and aggregating numerical properties across arbitrary tree depths. This challenge evaluates tree traversal techniques and clean implementation habits. Access the complete problem description and model solution with a subscription.
Coding QuestionsDatadogPermutation Check and Integer-Exponent Power
3/5A coding question with two short parts: validating that a list holds each value of a range exactly once, and computing an integer power of a float for very large exponents. It tests edge cases such as empty input, out-of-range values and negative exponents.
Coding QuestionsTeslaEmployee Training Status + Group Tree Aggregation
3/5This Vanta interview problem requires you to evaluate employee compliance status regarding security training across specified windows and aggregate these metrics hierarchically across organizational group trees. You will build logic to compute exact overdue days for individuals and roll those statistics upward to calculate cumulative headcounts and total delays for overarching departments. The challenge tests your ability to handle date arithmetic alongside recursive tree traversal and data aggregation. Access the full problem details and a clean model solution by subscribing today.
Coding QuestionsVantaN-ary Tree Sum + Leaf next Pointer
3/5In this multi-stage technical assessment from Citadel, candidates must work with custom tree structures, aggregate node values, and restructure references during traversal. The exercise progressively increases in difficulty, culminating in an optimized routine that rearranges pointers in constant auxiliary memory without relying on external collections. Tackling this problem demands strong pointer intuition and careful state management. Unlock the full problem description and expert code implementation with a paid subscription.
Coding QuestionsCitadelClient Request That Breaks Firm Policy Before a Deal Closes
3/5A behavioral question about a client request that breaks firm policy just before an important deal closes. It tests your judgment and integrity: what you would decide, whom you would involve, and how you would communicate with the client.
BehavioralGoldman SachsSerialize Arithmetic Expression Tree with Minimum Parentheses
4/5A coding question on writing an expression tree of variables and arithmetic operators out as a text formula. The output must stay as compact as possible while still meaning exactly the same thing. It tests careful reasoning about grouping and the order in which operations apply.
Coding QuestionsWaymoExpand Nested (group){k} Repeats
3/5A string-processing question about expanding a compact notation in which a count written after a bracketed group says how many times the group appears. Groups can sit inside other groups several levels deep, and a count can be zero or have many digits.
Coding QuestionsWaymoDice Roll Simulator and Multiplication-Free Factorial Calculation
2/5This reported Nomura interview challenge tests your foundational programming logic by asking you to build a stochastic simulator for random dice outcomes accompanied by verification test cases. Additionally, it requires implementing a mathematical factorial computation using unconventional constraints that forbid standard multiplication operators. You will need to demonstrate creative problem-solving and algorithmic thinking to handle these distinct computational tasks efficiently. Access to the complete problem description, edge-case evaluations, and fully functional model solutions requires an active subscription.
Coding QuestionsNomuraHyperparameter Combinations (Cartesian Product)
2/5This Pinterest interview question focuses on generating every possible configuration from a dictionary of tuning parameters and their respective candidate choices. You will explore how to compute full Cartesian products effectively in Python while considering robust test cases for validation. The task evaluates your fluency with combinatorial generation, nested iteration patterns, and clean utility design suited for machine learning platforms. Gain access to the full problem requirements, test suites, and optimal code by upgrading your subscription.
Coding QuestionsPinterestImplement a Calculator with Brackets
4/5In this classic expression evaluation challenge reported from WeRide, you must construct a robust arithmetic calculator that correctly handles basic operations along with parentheses and operator precedence rules. The task evaluates your ability to parse structured text strings efficiently while respecting mathematical hierarchy and integer division behaviors. Tackling this problem hones your stack-based parsing skills and algorithmic logic for complex string manipulation. Unlock the full problem details and reference solution by obtaining a subscription.
Coding QuestionsWeRideBinary Decoder / Simplified BSON Parser
4/5Parsing serialized byte streams is a classic systems-level challenge often featured in technical assessments, such as this reported MongoDB interview question. You will build a custom decoder that translates hexadecimal encoded binary formats into structured hierarchical objects, requiring careful handling of byte-level offsets and endianness. This puzzle tests your deep understanding of data serialization and memory layout manipulation. Gain access to the full problem statement, test cases, and a comprehensive code solution with a paid subscription.
Coding QuestionsMongoDBSpell a Word in a Grid
3/5A coding question about finding a string inside a two-dimensional grid of letters by stepping between neighboring cells without reusing any. It also asks the candidate to keep the input grid intact and to analyze the worst-case running time.
Coding QuestionsTuroReverse Nodes in k-Group (Incomplete Tail)
4/5Featured in ByteDance coding interviews, this problem requires you to reverse nodes in a linked list in fixed-size groups while leaving any remaining trailing nodes in their original order. The challenge specifically tests pointer manipulation skills, as you must relink nodes in-place without altering their underlying values. Reviewing the complete problem statement, pointer management strategies, and optimal model solution requires an active subscription.
Coding QuestionsByteDanceCount All Tic-Tac-Toe Game Sequences
3/5Asked during Decagon interviews, this combinatorial puzzle asks you to compute every possible unique sequence of turns in a traditional grid game. Rather than just looking at final outcomes, you must track the chronological order of moves for both participants, accounting for early terminations triggered by winning alignments or full boards. It examines your depth-first search strategy and combinatorial counting skills. To view the complete problem statement and reference solution, a subscription is required.
Coding QuestionsDecagonAll Ways to Split a Digit String into Strictly Increasing Numbers
3/5A coding question about a long string of numerals that you may chop into consecutive chunks. You list every chopping in which the chunks, read as numbers, keep growing, with special treatment for chunks that begin with a zero. It tests careful recursion, handling of edge cases and the order in which results are produced.
Coding QuestionsTemuList Every Root-to-Leaf Value Path
2/5A coding question about traversing a binary tree and returning every complete route to a leaf in deterministic order. It checks edge cases, very deep unbalanced trees and careful management of per-route state.
Coding QuestionsCapital OneSame N-ary Tree Comparison
2/5A coding question about checking whether two trees with any number of children per node match exactly. The trees can be very deep, so the comparison has to avoid relying on the call stack.
Coding QuestionsOracleIn-Memory File System
3/5This popular Harvey technical interview challenge asks you to build a simulated data hierarchy that supports directory navigation, file creation, and content retrieval using hierarchical naming paths. The exercise tests your proficiency with tree structures, custom parsing logic, and efficient in-memory data organization. Additional complexities involve handling duplicate naming conflicts and capacity limits within folders. Unlock the complete technical breakdown and expert solution by purchasing a subscription.
Coding QuestionsHarvey
Studied alongside
Recursion interview FAQ
- How many Recursion interview questions are there?
- 113 reported questions, mostly Coding Questions.
- Which companies ask Recursion questions?
- Amazon (11), Google (10), Snowflake (9), Uber (7), Meta (5), Apple (4), OpenAI (3), Databricks (3).
- How hard are Recursion questions?
- They average 3.0 out of 5: 21 at 2/5, 76 at 3/5, 16 at 4/5.