Intuit Previous Year Coding Questions

Intuit (makers of TurboTax, QuickBooks, Credit Karma, and Mailchimp) is one of the most sought-after fintech companies for Indian engineers. With a major engineering hub in Bengaluru and campuses across the US, Intuit hires aggressively from IITs, NITs, and top private universities. The interview process rewards clean, readable code over brute-force speed — interviewers explicitly look for edge-case handling and clear variable naming. The OA is notably rigorous: 4 DSA problems + 1 SQL + 1 Bash, all in 90 minutes. Onsite rounds emphasise breadth across arrays, DP, graphs, and trees. System design is introduced at the SDE-2 level. Intuit's engineering culture is deeply product-driven — expect interviewers to ask how your solution would behave under real financial data constraints (correctness, precision, large-scale transaction volumes).


Hiring Process

Step 1: Resume Screening Intuit's ATS filters for strong academic backgrounds (7+ CGPA), relevant internships, and projects that demonstrate product thinking. Fintech project experience (payment systems, data pipelines, budgeting tools) is a significant differentiator.

Step 2: Online Assessment (HackerRank / Internal Platform) Duration: 90 minutes. Format: 4 DSA coding problems (Easy to Medium-Hard) + 1 SQL question (JOINs, GROUP BY, HAVING) + 1 Bash scripting question (string processing, awk/sed). Code stability and edge-case handling are evaluated — a clean O(n²) solution beats a buggy O(n log n) one. Scoring: each problem is auto-judged; partial marks are NOT awarded.

Step 3: Recruiter Screening (30 mins) A phone call with a technical recruiter covering your tech stack, project highlights, DSA fundamentals, and expectations. This is eliminatory — candidates who cannot explain their own project tech stack are rejected here.

Step 4: Technical Round 1 — Phone Screen (45–60 mins) One medium-level DSA problem with live coding (CoderPad). Interviewers care deeply about your thought process: verbalize your approach before coding, handle edge cases proactively, and write production-quality code with meaningful variable names.

Step 5: Technical Round 2 — DSA + System Design (60–75 mins) Two interviewers. 1–2 DSA problems (medium to hard) + a high-level design discussion. At SDE-1 level the system design is conceptual (draw the API, describe the DB schema). At SDE-2 it is a full HLD with scalability discussion (design QuickBooks reconciliation engine or TurboTax's tax computation service).

Step 6: Hiring Manager Round (30–45 mins) Culture fit, career goals, and product thinking. Expect questions like "How would you improve the QuickBooks dashboard?" or "How would you handle a calculation bug that affects 10,000 tax returns?"

Tips: Focus heavily on DP, graph BFS/DFS, and interval problems — these dominate Intuit OAs. For SQL, practice multi-table JOINs with GROUP BY and window functions. For the phone screen, write clean code as if you are pushing to production: null checks, meaningful names, no magic numbers. Intuit strongly values engineers who think about real-world correctness (floating point precision in financial calculations is a common interview topic).


Preparation Resources

Part 1 — OA Questions

1. Two Sum Easy

OAArrays · HashingLeetCode: #1

Given an array of integers and a target, return indices of the two numbers that add up to the target. Intuit frames this as: given a list of transaction amounts, find two that sum to a given reconciliation total.

Input: nums = [2,7,11,15], target = 9
Output: [0,1]

Input: nums = [3,2,4], target = 6
Output: [1,2]

Approach: Hash map storing (value → index). For each element, check if (target - element) exists in the map. If yes, return the stored index and current index. Complexity: Time O(n) · Space O(n) Follow-up: Two Sum II (sorted array, LC #167) — use two pointers for O(1) space. Three Sum (LC #15) — fix one element and two-pointer the rest.


2. Merge Intervals Medium

OAArrays · Sorting · IntervalsLeetCode: #56

Given an array of intervals, merge all overlapping intervals and return the result. Intuit frames this as merging overlapping fiscal periods in a QuickBooks report.

Input: intervals = [[1,3],[2,6],[8,10],[15,18]]
Output: [[1,6],[8,10],[15,18]]

Input: intervals = [[1,4],[4,5]]
Output: [[1,5]]

Approach: Sort intervals by start time. Iterate through; if the current interval overlaps with the last merged (current.start ≤ last.end), extend the last interval's end to max(last.end, current.end). Otherwise, push the current interval as a new entry. Complexity: Time O(n log n) · Space O(n) Follow-up: Insert Interval (LC #57) — insert a new interval into an already-sorted non-overlapping list.


3. Longest Substring Without Repeating Characters Medium

OAStrings · Sliding Window · HashingLeetCode: #3

Find the length of the longest substring without repeating characters.

Input: s = "abcabcbb"
Output: 3  ("abc")

Input: s = "bbbbb"
Output: 1  ("b")

Input: s = "pwwkew"
Output: 3  ("wke")

Approach: Sliding window with a hash map (char → last seen index). Maintain a left pointer. When a repeating character is found, move left to max(left, lastSeen[char] + 1). Update the max window size at each step. Complexity: Time O(n) · Space O(min(n, charset)) Follow-up: Minimum Window Substring (LC #76) — find the smallest window containing all characters of a target string.


4. Rotting Oranges Medium

OABFS · Grid · GraphLeetCode: #994

In a grid, 0 = empty, 1 = fresh orange, 2 = rotten orange. Every minute, rotten oranges spread to adjacent fresh ones. Return the minimum minutes until no fresh oranges remain, or -1 if impossible.

Input: grid = [[2,1,1],[1,1,0],[0,1,1]]
Output: 4

Input: grid = [[2,1,1],[0,1,1],[1,0,1]]
Output: -1

Input: grid = [[0,2]]
Output: 0

Approach: Multi-source BFS. Enqueue all initially rotten oranges. Count fresh oranges. BFS level by level — each level = 1 minute. Decrement fresh count as oranges rot. If fresh > 0 after BFS, return -1. Complexity: Time O(m*n) · Space O(m*n) Follow-up: Walls and Gates (LC #286) — same multi-source BFS pattern but finding distances to nearest gate.


5. Partition Equal Subset Sum Medium

OADynamic Programming · KnapsackLeetCode: #416

Determine if a non-empty array can be partitioned into two subsets with equal sum. Intuit frames this as splitting transaction records into two balanced ledger groups.

Input: nums = [1,5,11,5]
Output: true  (subsets [1,5,5] and [11])

Input: nums = [1,2,3,5]
Output: false

Approach: If total sum is odd, return false. Target = sum/2. 0/1 Knapsack DP: dp[j] = true if sum j is achievable. Iterate nums; for each, update dp from right: dp[j] |= dp[j - num]. Complexity: Time O(n * sum) · Space O(sum) Follow-up: Target Sum (LC #494) — count ways to assign +/- signs to achieve a target value.


6. Maximum Subarray Medium

OADynamic Programming · Kadane's AlgorithmLeetCode: #53

Find the contiguous subarray with the largest sum. Intuit frames this as identifying the most profitable consecutive days of transactions in a QuickBooks P&L report.

Input: nums = [-2,1,-3,4,-1,2,1,-5,4]
Output: 6  (subarray [4,-1,2,1])

Input: nums = [1]
Output: 1

Input: nums = [5,4,-1,7,8]
Output: 23

Approach: Kadane's algorithm. Maintain currentSum = max(num, currentSum + num). Update maxSum = max(maxSum, currentSum). When currentSum goes negative, reset by taking the current element alone. Complexity: Time O(n) · Space O(1) Follow-up: Maximum Product Subarray (LC #152) — track both max and min products since negatives flip signs.


Part 2 — Phone Screen Questions

7. Valid Parentheses Easy

Phone ScreenStacks · StringsLeetCode: #20

Determine if a string of brackets is valid — every opening bracket must be closed in the correct order. Intuit frames this as validating formula syntax in TurboTax's expression engine.

Input: s = "()"
Output: true

Input: s = "()[]{}"
Output: true

Input: s = "(]"
Output: false

Input: s = "([)]"
Output: false

Approach: Stack. For each char: if opening bracket, push. If closing bracket, check if stack top is the matching opener; if not or stack is empty, return false. At end, return stack.isEmpty(). Complexity: Time O(n) · Space O(n) Follow-up: Minimum Add to Make Parentheses Valid (LC #921) — count minimum additions to balance a string.


8. Plus One Easy

Phone ScreenArrays · MathLeetCode: #66

Given a large integer represented as an array of digits, increment it by one and return the result array. Reported directly in Intuit phone screens in 2024.

Input: digits = [1,2,3]
Output: [1,2,4]

Input: digits = [9,9,9]
Output: [1,0,0,0]

Input: digits = [9]
Output: [1,0]

Approach: Traverse from right to left. If digit < 9, increment and return. If digit == 9, set to 0 and continue. If the loop completes (all 9s), prepend a 1 at the front. Complexity: Time O(n) · Space O(n) worst case Follow-up: Add to Array-Form of Integer (LC &#35;989) — add a single integer to an array-represented number.


9. Validate IP Address Medium

Phone ScreenStrings · SimulationLeetCode: #468

Validate whether a given string is a valid IPv4 or IPv6 address, or neither. Reported in Intuit phone screens — common in network and security-adjacent roles.

Input: queryIP = "172.16.254.1"
Output: "IPv4"

Input: queryIP = "2001:0db8:85a3:0:0:8A2E:0370:7334"
Output: "IPv6"

Input: queryIP = "256.256.256.256"
Output: "Neither"

Approach: Split on '.'; if 4 parts, validate each as a decimal integer 0–255 with no leading zeros. Split on ':'; if 8 parts, validate each as a 1–4 hex digit group. Edge cases: empty parts, leading zeros in IPv4, invalid hex chars in IPv6. Complexity: Time O(n) · Space O(1) Follow-up: IP to CIDR (LC &#35;751) — convert an IP range to the smallest set of CIDR blocks.


10. Two Sum II — Input Array Is Sorted Medium

Phone ScreenTwo Pointers · ArraysLeetCode: #167

Given a 1-indexed sorted array, find two numbers that add up to the target using O(1) extra space.

Input: numbers = [2,7,11,15], target = 9
Output: [1,2]

Input: numbers = [2,3,4], target = 6
Output: [1,3]

Input: numbers = [-1,0]
Output: [1,2]

Approach: Two pointers, left = 0 and right = n-1. If sum == target, return indices. If sum < target, move left right. If sum > target, move right left. The sorted property guarantees convergence. Complexity: Time O(n) · Space O(1) Follow-up: 3Sum (LC &#35;15) — fix one element and two-pointer the rest for all unique triplets.


11. Lowest Common Ancestor of a Binary Tree Medium

Phone ScreenTrees · DFS · RecursionLeetCode: #236

Given a binary tree and two nodes p and q, find their lowest common ancestor (LCA). The LCA is the deepest node that has both p and q as descendants. Reported in Intuit technical rounds.

Input: root = [3,5,1,6,2,0,8,null,null,7,4], p = 5, q = 1
Output: 3

Input: root = [3,5,1,6,2,0,8,null,null,7,4], p = 5, q = 4
Output: 5

Approach: Recursive post-order. If root is null/p/q, return root. Recurse on left and right. If both sides return non-null, root is the LCA. If only one side returns non-null, propagate that up. Complexity: Time O(n) · Space O(h) where h = tree height Follow-up: LCA of Deepest Leaves (LC &#35;1123) — find LCA of all deepest leaves in one pass.


12. Design Tic-Tac-Toe Medium

Phone ScreenDesign · Arrays · MathLeetCode: #348

Design a Tic-Tac-Toe game that is played on an n×n grid. Implement a move() method that returns 0 (no winner), 1 (player 1 wins), or 2 (player 2 wins) after each move. Reported in Intuit phone screens — tests design thinking and avoidance of brute-force O(n²) checking.

TicTacToe ticTacToe = new TicTacToe(3);
ticTacToe.move(0,0,1); // → 0
ticTacToe.move(0,2,2); // → 0
ticTacToe.move(2,2,1); // → 0
ticTacToe.move(1,1,2); // → 0
ticTacToe.move(2,0,1); // → 0
ticTacToe.move(1,0,2); // → 0
ticTacToe.move(2,1,1); // → 1  (player 1 wins row 2)

Approach: For each player, maintain row counts (rows[n]), col counts (cols[n]), and two diagonal counts. On each move, increment the appropriate row/col/diag counters. If any reaches n, that player wins. O(1) per move. Complexity: Time O(1) per move · Space O(n) Follow-up: Design Tic-Tac-Toe with arbitrary win conditions (k in a row on an n×n board).


13. My Calendar I Medium

Phone ScreenDesign · Sorted Map · IntervalsLeetCode: #729

Implement a calendar that can book events. An event [start, end) can be booked only if no existing event overlaps. Return true if booking succeeds, false otherwise. Intuit frames this as a financial appointment system.

MyCalendar cal = new MyCalendar();
cal.book(10,20); // → true
cal.book(15,25); // → false (overlaps [10,20))
cal.book(20,30); // → true

Approach: Use a sorted map (TreeMap). For each new event, find the floor entry (latest start ≤ new.start) and ceiling entry (earliest start ≥ new.start). Check the floor's end ≤ new.start and new.end ≤ ceiling's start. If both conditions hold, insert the new event. Complexity: Time O(log n) per booking · Space O(n) Follow-up: My Calendar II (LC &#35;731) — allow double-bookings but not triple-bookings.


Part 3 — Onsite Questions

14. Number of Islands Medium

OnsiteBFS/DFS · Graph · GridLeetCode: #200

Count the number of islands in a binary grid. An island is a group of connected 1s (horizontally or vertically). Reported in multiple Intuit onsite rounds.

Input: grid = [["1","1","0","0"],["1","1","0","0"],["0","0","1","0"],["0","0","0","1"]]
Output: 3

Input: grid = [["1","1","1"],["0","1","0"],["1","1","1"]]
Output: 1

Approach: DFS/BFS from each unvisited '1'. Mark all reachable connected cells as visited. Increment island count for each new DFS start. Complexity: Time O(m*n) · Space O(m*n) Follow-up: Max Area of Island (LC &#35;695) — return the size of the largest island instead of the count.


15. Group Anagrams Medium

OnsiteHashing · Strings · SortingLeetCode: #49

Group an array of strings into groups of anagrams. All anagrams must appear together.

Input: strs = ["eat","tea","tan","ate","nat","bat"]
Output: [["bat"],["nat","tan"],["ate","eat","tea"]]

Input: strs = [""]
Output: [[""]]

Approach: Hash map where the key is the sorted version of each string (or a character frequency tuple). Append each string to its group's list. Return all values of the map. Complexity: Time O(n * k log k) where k = max string length · Space O(nk) Follow-up: Use a 26-integer frequency array as the key instead of sorting for O(nk) time.


16. 3Sum Medium

OnsiteTwo Pointers · Sorting · ArraysLeetCode: #15

Find all unique triplets in an array that sum to zero. The solution set must not contain duplicate triplets.

Input: nums = [-1,0,1,2,-1,-4]
Output: [[-1,-1,2],[-1,0,1]]

Input: nums = [0,1,1]
Output: []

Approach: Sort the array. Fix the first element with index i. Use two pointers (left = i+1, right = n-1) to find pairs summing to -nums[i]. Skip duplicates after each match by advancing pointers past repeated values. Complexity: Time O(n²) · Space O(1) excluding output Follow-up: 3Sum Closest (LC &#35;16) — find the triplet whose sum is closest to a target.


17. Meeting Rooms II Medium

OnsiteHeap · Greedy · IntervalsLeetCode: #253

Find the minimum number of conference rooms required to schedule all meetings without overlap. Intuit frames this as allocating QuickBooks cloud instances to concurrent tax filing sessions.

Input: intervals = [[0,30],[5,10],[15,20]]
Output: 2

Input: intervals = [[7,10],[2,4]]
Output: 1

Approach: Sort by start time. Min-heap of end times. For each meeting: if heap top (earliest end) ≤ meeting start, reuse the room (pop and push new end). Otherwise add a new room (push end). Return heap size. Complexity: Time O(n log n) · Space O(n) Follow-up: Employee Free Time (LC &#35;759) — merge all employees' schedules and find gaps.


18. Decode String Medium

OnsiteStack · Strings · RecursionLeetCode: #394

Decode an encoded string where k[encoded_string] means repeat encoded_string k times. Brackets can be nested.

Input: s = "3[a]2[bc]"
Output: "aaabcbc"

Input: s = "3[a2[c]]"
Output: "accaccacc"

Approach: Stack-based. Maintain current string and current number. On '[', push (currentString, currentNum) onto stack; reset both. On ']', pop the pair and set currentString = poppedString + currentString poppedNum. On digit, accumulate currentNum. On letter, append to currentString. *Complexity: Time O(output length) · Space O(nesting depth) Follow-up: What if k is multi-digit? Parse digits greedily: currentNum = currentNum * 10 + digit.


19. Generate Parentheses Medium

OnsiteBacktracking · Recursion · StringsLeetCode: #22

Given n pairs of parentheses, generate all combinations of well-formed parentheses.

Input: n = 3
Output: ["((()))","(()())","(())()","()(())","()()()"]

Input: n = 1
Output: ["()"]

Approach: Backtracking with open and close counters. Add '(' if open < n. Add ')' if close < open. When both reach n, add the string to results. This generates only valid combinations without needing post-validation. Complexity: Time O(4^n / sqrt(n)) (Catalan number) · Space O(n) call stack Follow-up: Remove Invalid Parentheses (LC &#35;301) — remove the minimum number of invalid parentheses.


20. Subdomain Visit Count Medium

OnsiteHashing · StringsLeetCode: #811

Given an array of count-domain pairs like "9001 discuss.leetcode.com", return the total visit count for every domain and subdomain. Intuit frames this as aggregating analytics events across product domains.

Input: cpdomains = ["9001 discuss.leetcode.com"]
Output: ["9001 leetcode.com","9001 discuss.leetcode.com","9001 com"]

Input: cpdomains = ["900 google.mail.com","50 yahoo.com","1 intel.mail.com","5 wiki.org"]
Output: ["901 mail.com","50 yahoo.com","900 google.mail.com","5 wiki.org","5 org","1 intel.mail.com","951 com"]

Approach: Hash map. Split each entry on space to get count and domain. Split domain on '.' to generate all suffix-level subdomains. Add the count to each subdomain in the map. Complexity: Time O(n * L) where L = max domain length · Space O(n * L) Follow-up: How would you design a real-time DNS analytics aggregator at 1M events/sec?


21. Max Area of Island Medium

OnsiteBFS/DFS · Grid · GraphLeetCode: #695

Find the maximum area of an island in a binary grid. An island is a group of connected 1s (4-directional).

Input: grid = [[0,0,1,0,0,0,0,1,0,0,0,0,0],[0,0,0,0,0,0,0,1,1,1,0,0,0],...]
Output: 6

Input: grid = [[0,0,0,0,0,0,0,0]]
Output: 0

Approach: DFS from each unvisited 1. Return the size of the component. Track the maximum size seen across all components. Complexity: Time O(m*n) · Space O(m*n) Follow-up: Number of Distinct Islands (LC &#35;694) — count islands with unique shapes by normalising DFS traversal paths.


22. Container With Most Water Medium

OnsiteTwo Pointers · Greedy · ArraysLeetCode: #11

Given n vertical lines represented by heights, find two lines that together with the x-axis form a container that holds the most water.

Input: height = [1,8,6,2,5,4,8,3,7]
Output: 49  (lines at index 1 and 8: min(8,7) * (8-1) = 49)

Input: height = [1,1]
Output: 1

Approach: Two pointers starting at both ends. Area = min(height[l], height[r]) (r - l). Move the shorter line inward (there's no benefit to moving the taller one). Update max area at each step. *Complexity: Time O(n) · Space O(1) Follow-up: Trapping Rain Water (LC &#35;42) — sum the water trapped between bars (not just the max container).


23. Letter Combinations of a Phone Number Medium

OnsiteBacktracking · Recursion · StringsLeetCode: #17

Given a string of digits 2–9, return all possible letter combinations the digits could represent (standard phone keypad mapping).

Input: digits = "23"
Output: ["ad","ae","af","bd","be","bf","cd","ce","cf"]

Input: digits = ""
Output: []

Approach: Backtracking. Define a digit→letters map. Recurse through each digit's letters, building a path. When path length equals digits length, add to result. Complexity: Time O(4^n * n) · Space O(n) call stack Follow-up: Implement a T9 predictive text system that filters combinations by a dictionary of valid words.


24. Reorganize String Medium

OnsiteHeap · Greedy · StringsLeetCode: #767

Rearrange a string so no two adjacent characters are the same. Return any valid arrangement or "" if impossible.

Input: s = "aab"
Output: "aba"

Input: s = "aaab"
Output: ""

Input: s = "vvvlo"
Output: "vlvov"

Approach: Frequency map + max-heap by frequency. Greedily pick the most frequent character that differs from the previous one. If the most frequent equals the previous, take the second most frequent. If impossible (max freq > (n+1)/2), return "". Complexity: Time O(n log k) where k = distinct chars · Space O(k) Follow-up: Task Scheduler (LC &#35;621) — find minimum time to finish tasks with cooldown between same-type tasks.


25. Boats to Save People Medium

OnsiteGreedy · Two Pointers · SortingLeetCode: #881

Each boat carries at most 2 people with total weight ≤ limit. Find the minimum number of boats needed. Each person can board at most one boat.

Input: people = [1,2], limit = 3
Output: 1

Input: people = [3,2,2,1], limit = 3
Output: 3

Input: people = [3,5,3,4], limit = 5
Output: 4

Approach: Sort the array. Two pointers: lightest (left) and heaviest (right). If they fit together, advance both. Otherwise, the heaviest must go alone (advance right only). Count boats used. Complexity: Time O(n log n) · Space O(1) Follow-up: What if each boat can carry 3 people? Extend to check the two lightest together with the heaviest.


26. Clone Graph Medium

OnsiteGraph · BFS · HashingLeetCode: #133

Return a deep copy of an undirected graph where each node has a val and a list of neighbours.

Input: adjList = [[2,4],[1,3],[2,4],[1,3]]
Output: [[2,4],[1,3],[2,4],[1,3]]  (deep copy, distinct node objects)

Approach: BFS with a hash map (originalNode → clonedNode). For each node dequeued, iterate its neighbours: if no clone exists, create one and enqueue it. Add the cloned neighbour to the current clone's neighbour list. Complexity: Time O(V+E) · Space O(V) Follow-up: Deep Copy an N-ary tree — same pattern but with N children instead of arbitrary graph neighbours.


27. Course Schedule Medium

OnsiteGraph · Topological Sort · Cycle DetectionLeetCode: #207

Given numCourses and prerequisite pairs [a, b] (b must be taken before a), determine if it is possible to finish all courses. Reported in Intuit onsite rounds — tests topological sort / cycle detection.

Input: numCourses = 2, prerequisites = [[1,0]]
Output: true

Input: numCourses = 2, prerequisites = [[1,0],[0,1]]
Output: false  (cycle: 0→1→0)

Approach: Build directed graph. DFS cycle detection with 3 states: unvisited, in-progress, done. If we reach an in-progress node, a cycle exists. Alternatively, Kahn's BFS: process nodes with in-degree 0; decrement neighbours' in-degree; if processed count < numCourses, cycle exists. Complexity: Time O(V+E) · Space O(V+E) Follow-up: Course Schedule II (LC &#35;210) — return the actual topological order of courses.


28. Course Schedule II Medium

OnsiteGraph · Topological Sort · DFSLeetCode: #210

Return a valid ordering of courses to take given prerequisites, or an empty array if impossible (cycle exists). Reported in Intuit onsite — directly follows up Course Schedule.

Input: numCourses = 4, prerequisites = [[1,0],[2,0],[3,1],[3,2]]
Output: [0,2,1,3]  (or any valid topological order)

Input: numCourses = 2, prerequisites = [[1,0],[0,1]]
Output: []

Approach: Post-order DFS — add a node to the result list AFTER all its dependents are processed. Reverse the list at the end. Detect cycles with an in-progress state. Alternatively use Kahn's BFS with in-degree array. Complexity: Time O(V+E) · Space O(V+E) Follow-up: Alien Dictionary (LC &#35;269) — infer character ordering from a sorted word list using topological sort.


29. Word Ladder Hard

OnsiteBFS · Graph · StringsLeetCode: #127

Find the shortest transformation sequence from beginWord to endWord, changing one letter at a time, where each intermediate word must exist in a given word list. Return the number of words in the shortest chain.

Input: beginWord = "hit", endWord = "cog", wordList = ["hot","dot","dog","lot","log","cog"]
Output: 5  ("hit"→"hot"→"dot"→"dog"→"cog")

Input: beginWord = "hit", endWord = "cog", wordList = ["hot","dot","dog","lot","log"]
Output: 0  (endWord not in list)

Approach: BFS level by level. For each word, generate all one-letter-change variants and check against a set built from the word list. Enqueue unvisited matches and remove from the set to prevent revisiting. Return level count when endWord is reached. Complexity: Time O(n * L²) where n = wordList size, L = word length · Space O(n) Follow-up: Bidirectional BFS from both ends simultaneously — reduces search space from O(b^d) to O(b^(d/2)).


30. Trapping Rain Water Hard

OnsiteTwo Pointers · Dynamic Programming · StackLeetCode: #42

Given n non-negative integers representing elevation heights, compute how much rainwater can be trapped after raining.

Input: height = [0,1,0,2,1,0,1,3,2,1,2,1]
Output: 6

Input: height = [4,2,0,3,2,5]
Output: 9

Approach: Two pointers. Maintain leftMax and rightMax. Whichever side has the smaller max determines the water level at that position: water[i] = min(leftMax, rightMax) - height[i]. Advance the pointer on the side with the smaller max. Complexity: Time O(n) · Space O(1) Follow-up: Trapping Rain Water II (LC &#35;407) — same problem extended to a 2D elevation map using a min-heap.


31. Merge k Sorted Lists Hard

OnsiteHeap · Linked Lists · Divide and ConquerLeetCode: #23

Merge k sorted linked lists into one sorted linked list. Intuit frames this as merging k sorted transaction streams from different QuickBooks accounts.

Input: lists = [[1,4,5],[1,3,4],[2,6]]
Output: [1,1,2,3,4,4,5,6]

Input: lists = []
Output: []

Approach: Min-heap storing (node.val, listIndex, node). Pop the minimum node, add to result, push its next node onto the heap. This processes all nk nodes in O(n*k log k) time. Complexity: Time O(nk log k) · Space O(k) Follow-up: Merge k Sorted Arrays — same approach using indices into each array instead of linked list node pointers.


32. Binary Tree Inorder Traversal Easy

OnsiteTrees · DFS · StackLeetCode: #94

Return the inorder traversal (left → root → right) of a binary tree's node values. Interviewers often ask for the iterative solution.

Input: root = [1,null,2,3]
Output: [1,3,2]

Input: root = []
Output: []

Approach (iterative): Stack. Push left spine until null. Pop node, add value to result. Move to right child and repeat. This exactly mirrors recursive left-root-right order without recursion stack overflow risk. Complexity: Time O(n) · Space O(h) Follow-up: Validate BST (LC &#35;98) — inorder traversal of BST should give strictly increasing sequence.


33. Valid Sudoku Medium

OnsiteHashing · Arrays · SimulationLeetCode: #36

Determine if a 9×9 partially filled Sudoku board is valid. Each row, column, and 3×3 box must contain digits 1–9 with no repeats.

Input: board = [["5","3",".",".","7",".",".",".","."],["6",".",".","1","9","5",...]...]
Output: true

Approach: Single pass. For each cell (i, j) with a digit: check three sets — rows[i], cols[j], boxes[i/33 + j/3]. If digit already exists in any set, return false. Otherwise insert. *Complexity: Time O(81) = O(1) · Space O(81) = O(1) Follow-up: Sudoku Solver (LC &#35;37) — fill in the empty cells using backtracking.


34. Delete Nodes And Return Forest Medium

OnsiteTrees · DFS · HashingLeetCode: #1110

Given a binary tree and a set of node values to delete, return the roots of the remaining forest (trees formed after deletions).

Input: root = [1,2,3,4,5,6,7], to_delete = [3,5]
Output: [[1,2,null,4],[6],[7]]

Approach: Post-order DFS. After processing children, if the current node is in the delete set, add its non-null children to the forest list and return null. A node becomes a new root if it was not deleted and its parent was deleted (or it's the original root). Complexity: Time O(n) · Space O(n + d) where d = delete set size Follow-up: Extend to an N-ary tree — same logic, iterate over all children instead of just left/right.


35. Diameter of Binary Tree Easy

OnsiteTrees · DFS · RecursionLeetCode: #543

Find the length of the longest path between any two nodes in a binary tree. The path may or may not pass through the root.

Input: root = [1,2,3,4,5]
Output: 3  (path: 4→2→1→3 or 5→2→1→3)

Input: root = [1,2]
Output: 1

Approach: DFS returning the height of each subtree. At each node, the local diameter = leftHeight + rightHeight. Update a global max. Return max(leftHeight, rightHeight) + 1 up to parent. Complexity: Time O(n) · Space O(h) Follow-up: Binary Tree Maximum Path Sum (LC &#35;124) — same structure but maximise node value sums instead of path length.


36. Best Time to Buy and Sell Stock Easy

OnsiteArrays · DP · GreedyLeetCode: #121

Find the maximum profit from one buy-sell transaction. You must buy before you sell. Intuit frames this as finding the optimal trade window in a stock portfolio tracker.

Input: prices = [7,1,5,3,6,4]
Output: 5  (buy at 1, sell at 6)

Input: prices = [7,6,4,3,1]
Output: 0  (no profit possible)

Approach: Track the minimum price seen so far. At each price, compute profit = price - minPrice and update maxProfit. One pass. Complexity: Time O(n) · Space O(1) Follow-up: Best Time to Buy and Sell Stock II (LC &#35;122) — unlimited transactions; Best Time III (LC &#35;123) — at most 2 transactions.


37. Happy Number Easy

OnsiteMath · Hashing · Floyd's CycleLeetCode: #202

A happy number reaches 1 when repeatedly replaced by the sum of the squares of its digits. Detect if a number is happy (or enters a cycle).

Input: n = 19
Output: true  (19→82→68→100→1)

Input: n = 2
Output: false  (enters cycle: 2→4→16→37→58→89→145→42→20→4→...)

Approach: Use Floyd's cycle detection (slow/fast pointers) on the sequence of digit-square-sums. If fast reaches 1, it's happy. If slow and fast meet at a non-1 number, there is a cycle. Complexity: Time O(log n) per step · Space O(1) Follow-up: Why do all non-happy numbers eventually reach 4 and cycle through the same 8 values? Discuss mathematical properties.


38. Intersection of Two Linked Lists Easy

OnsiteLinked Lists · Two PointersLeetCode: #160

Find the node where two linked lists intersect, or null if they do not. O(1) space required.

Input: listA = [4,1,8,4,5], listB = [5,6,1,8,4,5]  (intersect at node 8)
Output: Reference to node 8

Approach: Two pointers starting at headA and headB. When a pointer reaches the end of its list, redirect it to the head of the OTHER list. They will meet at the intersection node after traversing (lenA + lenB) total nodes, or both reach null simultaneously (no intersection). Complexity: Time O(m+n) · Space O(1) Follow-up: Linked List Cycle II (LC &#35;142) — find where a cycle begins using the same two-pointer technique.


39. Climbing Stairs Easy

OnsiteDynamic Programming · FibonacciLeetCode: #70

Count distinct ways to climb n stairs taking 1 or 2 steps at a time. This is the Fibonacci sequence starting at 1, 1, 2, 3, 5... Reported as a warm-up problem in Intuit onsite rounds.

Input: n = 2
Output: 2  ([1+1], [2])

Input: n = 3
Output: 3  ([1+1+1], [1+2], [2+1])

Approach: ways(n) = ways(n-1) + ways(n-2). Use two variables (prev, curr) and iterate — no array needed. Complexity: Time O(n) · Space O(1) Follow-up: Min Cost Climbing Stairs (LC &#35;746) — minimise total cost. Stair case with k steps allowed — dp[n] = sum of dp[n-1] to dp[n-k].


40. Palindrome Linked List Easy

OnsiteLinked Lists · Two Pointers · RecursionLeetCode: #234

Determine if a singly linked list is a palindrome in O(n) time and O(1) space.

Input: head = [1,2,2,1]
Output: true

Input: head = [1,2]
Output: false

Approach: Find the midpoint using slow/fast pointers. Reverse the second half in place. Compare both halves node by node. Optionally restore the second half after comparison. Complexity: Time O(n) · Space O(1) Follow-up: Can you do it recursively in O(n) space? Yes — use a front pointer advanced at each return level of the recursion stack.


41. Design Circular Queue Medium

OnsiteDesign · Arrays · QueuesLeetCode: #622

Design a circular queue (ring buffer) supporting enQueue, deQueue, Front, Rear, isEmpty, and isFull — all in O(1) time. Intuit frames this as a fixed-size transaction buffer for real-time processing.

MyCircularQueue q = new MyCircularQueue(3);
q.enQueue(1); // true
q.enQueue(2); // true
q.enQueue(3); // true
q.enQueue(4); // false (full)
q.Rear();     // 3
q.isFull();   // true
q.deQueue();  // true
q.enQueue(4); // true
q.Rear();     // 4

Approach: Fixed-size array with head and tail pointers. Advance tail on enQueue: tail = (tail+1) % k. Advance head on deQueue: head = (head+1) % k. Track size for isEmpty/isFull — avoid conflating empty/full states through modular arithmetic alone. Complexity: Time O(1) per operation · Space O(k) Follow-up: Design Circular Deque (LC &#35;641) — add addFront and addLast, deleteFront and deleteLast operations.


42. Maximum Length of Repeated Subarray Medium

OnsiteDynamic Programming · Sliding Window · Binary SearchLeetCode: #718

Find the maximum length of a subarray that appears in both arrays nums1 and nums2. Intuit frames this as finding the longest common transaction sequence across two accounts.

Input: nums1 = [1,2,3,2,1], nums2 = [3,2,1,4,7]
Output: 3  (subarray [3,2,1])

Input: nums1 = [0,0,0,0,0], nums2 = [0,0,0,0,0]
Output: 5

Approach: 2D DP. dp[i][j] = length of longest common subarray ending at nums1[i-1] and nums2[j-1]. If nums1[i-1] == nums2= dpi-1 + 1. Track the global max. Complexity: Time O(m*n) · Space O(m*n) (reducible to O(n) with rolling array) Follow-up: Longest Common Subsequence (LC &#35;1143) — elements don't have to be contiguous; subsequence instead of subarray.


43. Unique Email Addresses Easy

OnsiteStrings · Hashing · SimulationLeetCode: #929

Count the number of unique email addresses after applying two rules: dots in the local name are ignored, and everything after a '+' in the local name is ignored.

Input: emails = ["test.email+alex@leetcode.com","test.e.mail+bob.cathy@leetcode.com","testemail+david@lee.tcode.com"]
Output: 2  (both normalize to "testemail@leetcode.com")

Approach: For each email, split on '@'. In the local part, take everything before '+', then remove all '.'. Reconstruct canonical email and add to a set. Return set size. Complexity: Time O(n * L) where L = max email length · Space O(n) Follow-up: Intuit variant — also handle case-insensitive domains, where "Gmail.COM" == "gmail.com".


44. Reverse Linked List Easy

OnsiteLinked Lists · Two PointersLeetCode: #206

Reverse a singly linked list. Implement both iterative and recursive solutions. A classic Intuit warm-up problem — interviewers follow up with Reverse in Groups (LC &#35;25).

Input: head = [1,2,3,4,5]
Output: [5,4,3,2,1]

Input: head = [1,2]
Output: [2,1]

Approach (iterative): Three pointers — prev = null, curr = head. While curr != null: next = curr.next; curr.next = prev; prev = curr; curr = next. Return prev. Complexity: Time O(n) · Space O(1) Follow-up: Reverse Linked List II (LC &#35;92) — reverse only the sublist from position left to right.


45. Merge Two Sorted Lists Easy

OnsiteLinked Lists · RecursionLeetCode: #21

Merge two sorted linked lists into one sorted linked list. Return the merged list.

Input: list1 = [1,2,4], list2 = [1,3,4]
Output: [1,1,2,3,4,4]

Input: list1 = [], list2 = [0]
Output: [0]

Approach: Dummy head node. Compare list1.val and list2.val; attach the smaller node to the result and advance that pointer. When one list is exhausted, attach the remainder of the other list. Complexity: Time O(m+n) · Space O(1) Follow-up: Merge k Sorted Lists (LC &#35;23) — generalise using a min-heap.


46. Populating Next Right Pointers in Each Node Medium

OnsiteTrees · BFS · Linked ListsLeetCode: #116

Connect each node's 'next' pointer to its right neighbour in the same level. The rightmost node on each level points to null. For a perfect binary tree.

Input: root = [1,2,3,4,5,6,7]
Output: [1,#,2,3,#,4,5,6,7,#]  (next pointers set)

Approach (O(1) space): Use the already-set next pointers to traverse each level. For each node, set node.left.next = node.right. If node.next exists, set node.right.next = node.next.left. Advance through the current level using next pointers. Complexity: Time O(n) · Space O(1) Follow-up: Populating Next Right Pointers II (LC &#35;117) — same but for any binary tree (not necessarily perfect). Use a dummy head for each level.


47. Word Break Medium

OnsiteDynamic Programming · Trie · BFSLeetCode: #139

Determine if a string s can be segmented into words from a given dictionary. Intuit frames this as validating if a customer's tax form description can be parsed by a known taxonomy of financial terms.

Input: s = "leetcode", wordDict = ["leet","code"]
Output: true

Input: s = "applepenapple", wordDict = ["apple","pen"]
Output: true

Input: s = "catsandog", wordDict = ["cats","dog","sand","and","cat"]
Output: false

Approach: DP array where dp[i] = true if s[0..i) can be segmented. For each i, check all j < i: if dp[j] is true and s[j..i) is in the word set, set dp[i] = true. Return dp[n]. Complexity: Time O(n²) · Space O(n) Follow-up: Word Break II (LC &#35;140) — return all valid segmentation sentences, not just boolean.


48. Median of Two Sorted Arrays Hard

OnsiteBinary Search · Arrays · MathLeetCode: #4

Find the median of two sorted arrays in O(log(m+n)) time. Intuit frames this as computing the median income across two different customer cohorts' income distributions stored in separate sorted arrays.

Input: nums1 = [1,3], nums2 = [2]
Output: 2.0

Input: nums1 = [1,2], nums2 = [3,4]
Output: 2.5

Approach: Binary search on the smaller array. Partition both arrays such that left halves together have (m+n+1)/2 elements. Adjust the partition until max(left sides) ≤ min(right sides). The median is then computable from the boundary elements. Complexity: Time O(log(min(m,n))) · Space O(1) Follow-up: Kth Smallest Element in Two Sorted Arrays — generalise to find the kth element instead of the median.


49. Parsing A Boolean Expression Hard

OnsiteStack · Recursion · StringsLeetCode: #1106

Evaluate a boolean expression string. Operators: !(expr) negates, &(expr1,expr2,...) is AND, |(expr1,expr2,...) is OR. Intuit frames this as evaluating eligibility rules in TurboTax's conditional logic engine.

Input: expression = "!(f)"
Output: true

Input: expression = "|(f,t)"
Output: true

Input: expression = "&(|(f,t),!(t))"
Output: false

Input: expression = "|(&(t,f,t),!(t))"
Output: false

Approach: Stack-based. Push operators and '(' when encountered. On ')': pop values from the stack until '(' is hit, then pop the operator. Apply operator to collected values (AND: all must be true; OR: any must be true; NOT: flip the single value). Push the result. Return the final stack value. Complexity: Time O(n) · Space O(n) Follow-up: Boolean Parenthesization — count ways to parenthesize a boolean expression to evaluate to True using DP.


50. Minimum Path Sum Medium

OnsiteDynamic Programming · GridLeetCode: #64

Find the minimum sum path from the top-left to bottom-right of a grid, moving only right or down. Intuit frames this as finding the minimum-cost processing pipeline in a financial data workflow grid.

Input: grid = [[1,3,1],[1,5,1],[4,2,1]]
Output: 7  (path: 1→3→1→1→1)

Input: grid = [[1,2,3],[4,5,6]]
Output: 12  (path: 1→2→3→6)

Approach: In-place DP. Fill the first row and column with cumulative sums. For each remaining cell: dp[i][j] = grid[i][j] + min(dp[i-1][j], dpi). Answer is dp[m-1][n-1]. Complexity: Time O(m*n) · Space O(1) (modifying grid in place) Follow-up: Triangle (LC &#35;120) — minimum path sum in a triangle, bottom-up DP.


Preparation Tips

Focus your Intuit preparation on DP and graph problems — they appear in almost every OA and at least one onsite round. For DP, master the 0/1 Knapsack, Kadane's algorithm, and 2D grid DP patterns. For graphs, be comfortable with both DFS cycle detection and BFS for shortest paths. Practise writing clean, readable code with meaningful variable names — Intuit interviewers explicitly evaluate code quality, not just correctness. The SQL round in the OA is straightforward: practise GROUP BY with HAVING, multi-table JOINs, and window functions. The Bash round tests basic string processing — know awk, sed, and grep patterns. For system design (SDE-2), think deeply about how TurboTax or QuickBooks would handle data at scale — correctness and consistency matter more than raw throughput in fintech.

Join our Telegram group for Intuit interview experiences, OA question sets, and placement preparation resources shared by students placed at Intuit India.

Useful Resources