Adobe Coding Interview Questions : OA, MTS Rounds & Onsite

Adobe is one of the world's leading software companies, known for Photoshop, Acrobat, Premiere Pro, and the Creative Cloud platform. Their engineering teams — spanning document intelligence, creative tools, digital experience, and cloud infrastructure — build products used by over 30 million creative professionals and enterprises globally.

Whether you are targeting a Member of Technical Staff (MTS-1 / MTS-2), Software Development Engineer, or Intern role, Adobe's interview process tests strong DSA foundations, OOP design, and the ability to write clean, production-quality code. C++ is preferred but Java and Python are accepted. This guide covers the full hiring pipeline, what to prepare, and 50 actual questions reported by candidates.


Adobe Hiring Process

Adobe's technology hiring follows a structured multi-stage process:

  1. Application & Resume Screening

    • Apply via Adobe's careers portal (adobe.com/careers), campus placements, LinkedIn, or referrals.
    • Highlight projects involving multimedia processing, cloud systems, document handling, or any creative-tech domain. C++ projects stand out for MTS roles.
    • Campus MTS-1 applicants are considered alongside off-campus applicants in a single pool — Adobe actively recruits from Tier-1 and Tier-2 colleges alike.
  2. Online Assessment — HackerRank / CodeSignal

    • Shortlisted candidates receive an OA link (typically HackerRank).
    • Format: 70–90 minutes with 2–3 coding problems (Easy to Medium). Occasionally includes 45 MCQs on C/C++ output prediction, aptitude, and data structures.
    • Topics: arrays, strings, trees, linked lists, stack/queue, basic DP, and number theory.
    • Tip: The OA is intentionally not very hard — Adobe tests speed and correctness, not just difficulty. Clean solutions that handle all edge cases matter more than brute-force hacks that pass most test cases.
  3. Technical Phone / Video Screen (Round 1)

    • A 45–60 minute session with a senior Adobe engineer on HackerRank or CoderPad.
    • 1–2 problems ranging from Easy to Medium-Hard. Expect follow-up questions on complexity, edge cases, and code quality.
    • Topics: linked lists, trees, BST validation, sliding window, basic DP.
    • Tip: Adobe interviewers emphasise code quality — clean variable names, proper modularisation, and handling nulls and edge cases before being asked to.
  4. Technical F2F Rounds (2–3 Rounds, 45–60 min each)

    • Round 1 — DSA Deep Dive: Core data structures and algorithm problems, Medium to Hard. Expect to walk through your entire solution verbally before coding.
    • Round 2 — Design & OOP: LRU Cache, Rate Limiter, Text Justification, or similar design-heavy problems. For MTS roles, expect questions on C++ STL internals, virtual functions, templates, and memory management.
    • Round 3 — Advanced DSA / Domain: For MTS-2 and experienced roles, a harder problem (graph, DP, or string processing) combined with discussion of trade-offs and real-world constraints. May include Adobe-domain problems: image processing (flood fill, region detection), document handling (text layout), or Creative Cloud systems (sync, caching).
    • Tip: Adobe rounds are conversational — interviewers want to understand how you think. State your approach clearly before writing a single line. Ask clarifying questions about constraints.
  5. Hiring Manager / Director Round

    • Behavioural and cultural fit questions, discussion of past projects, and sometimes a light technical problem.
    • Questions around ownership, cross-team collaboration, and handling ambiguity.
    • Tip: Use the STAR format. Mention specific metrics and impact in your project stories.
  6. HR Round & Offer

    • Compensation discussion, timeline confirmation, and team matching.
    • Adobe offers competitive base salary, annual bonuses, RSUs, and Creative Cloud subscription perks.
    • Results typically arrive within 10–15 business days. Campus offers are released December–February.

Preparation Resources

Part 1 — Online Assessment (OA) Questions

These questions appear most frequently in Adobe's HackerRank / CodeSignal OA. The OA is 70–90 minutes. Adobe values correctness and edge-case handling over raw difficulty.


1. Best Time to Buy and Sell Stock Easy

OAArrays · GreedyLeetCode:#121

Given an array prices where prices[i] is the stock price on day i, return the maximum profit from one buy-sell transaction.

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

Approach: Track running minimum. At each day, profit = price − min_so_far. Update global max.

Complexity: Time O(n) · Space O(1)

Follow-up: At most 2 transactions (LeetCode 123 — 4-state DP: buy1, sell1, buy2, sell2).


2. Valid Parentheses Easy

OAStack · StringsLeetCode:#20

Given a string containing (, ), {, }, [, ], determine if it is valid (every open bracket is closed in the correct order).

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

Approach: Push open brackets onto a stack. For each close bracket, check if the stack top is the matching open bracket. Return true if stack is empty at end.

Complexity: Time O(n) · Space O(n)

Follow-up: Minimum insertions to balance a parentheses string (LeetCode 1312 — DP).


3. Climbing Stairs Easy

OADynamic ProgrammingLeetCode:#70

You can climb 1 or 2 steps at a time. Count the number of distinct ways to reach the top of n stairs.

Input:  n = 5
Output: 8

Approach: Fibonacci recurrence. dp[i] = dp[i-1] + dp[i-2]. Space-optimise to two variables.

Complexity: Time O(n) · Space O(1)

Follow-up: What if you can also jump 3 steps? (Tribonacci recurrence.)


4. Number of Islands Medium

OADFS · BFS · MatrixLeetCode:#200

Given a 2D binary grid of '1's (land) and '0's (water), return the number of islands.

Input:  [["1","1","0"],["0","1","0"],["0","0","1"]]
Output: 2

Approach: DFS from each unvisited '1', marking visited cells as '0'. Each DFS call = one island.

Complexity: Time O(m·n) · Space O(m·n)

Follow-up: Max area of island (LeetCode 695 — return max DFS component size).


5. Rotting Oranges Medium

OAMulti-source BFS · MatrixLeetCode:#994

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

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

Approach: Multi-source BFS starting from all initially rotten cells simultaneously. Track minutes as BFS levels. After BFS check if any 1 remains.

Complexity: Time O(m·n) · Space O(m·n)

Follow-up: What if diagonals also spread rot? (Add 4 diagonal directions to BFS.)


6. Unique Paths Medium

OADynamic Programming · MathLeetCode:#62

A robot on an m×n grid can only move right or down. Count distinct paths from top-left to bottom-right.

Input:  m = 3, n = 7
Output: 28

Approach: dp[i][j] = dp[i-1][j] + dp[i][j-1]. Optimise to a single row.

Complexity: Time O(m·n) · Space O(n)

Follow-up: Unique Paths II with obstacles (LeetCode 63 — set blocked cells to 0).


Part 2 — Phone Screen & Round 1 Questions

These appear in Adobe's first technical video interview (45–60 min). Expect 1–2 problems followed by discussion on complexity and code quality.


7. Reverse a Linked List Easy

Round 1Linked List · Two PointersLeetCode:#206

Reverse a singly linked list iteratively and recursively.

Input:  1 -> 2 -> 3 -> 4 -> 5
Output: 5 -> 4 -> 3 -> 2 -> 1

Approach: Three pointers: prev = null, curr = head, next. At each step: save next = curr.next, point curr.next = prev, advance both.

Complexity: Time O(n) · Space O(1)

Follow-up: Reverse only nodes from position m to n (LeetCode 92 — in one pass).


8. Lowest Common Ancestor of BST Easy

Round 1BST · RecursionLeetCode:#235

Given a BST and two nodes p and q, find their lowest common ancestor.

Input:  root = [6,2,8,0,4,7,9], p = 2, q = 8
Output: 6

Approach: Use BST property. If both p and q are less than root, go left. If both greater, go right. Otherwise root is the LCA.

Complexity: Time O(h) · Space O(1) iterative

Follow-up: LCA in a general binary tree (LeetCode 236 — post-order DFS, return node when p or q found).


9. Validate Binary Search Tree Medium

Round 1BST · DFSLeetCode:#98

Given the root of a binary tree, determine if it is a valid BST.

Input:  root = [5,1,4,null,null,3,6]
Output: false  (4 is in right subtree but 3 < 5)

Approach: Recursive with min/max bounds. Pass (node, min=-∞, max=+∞). Each node must satisfy min < node.val < max. Update bounds when going left/right.

Complexity: Time O(n) · Space O(h)

Follow-up: Recover BST where exactly two nodes are swapped (LeetCode 99 — Morris traversal in O(1) space).


10. Merge Two Sorted Lists Easy

Round 1Linked List · Two PointersLeetCode:&#35;21

Merge two sorted linked lists into one sorted list.

Input:  l1 = [1,2,4], l2 = [1,3,4]
Output: [1,1,2,3,4,4]

Approach: Use a dummy head. Compare heads of both lists, append the smaller, advance that pointer. Attach the remaining list at the end.

Complexity: Time O(m+n) · Space O(1)

Follow-up: Merge k sorted lists (LeetCode 23 — divide and conquer or min-heap).


11. Longest Substring Without Repeating Characters Medium

Round 1Sliding Window · HashMapLeetCode:&#35;3

Find the length of the longest substring without repeating characters.

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

Approach: Sliding window with a HashMap storing the last seen index of each character. When a repeat is found, move left to max(left, last_seen[char] + 1).

Complexity: Time O(n) · Space O(min(n, alphabet))

Follow-up: Longest substring with at most k distinct characters (LeetCode 340 — same window, track distinct count).


12. Clone Linked List with Random Pointers Medium

Round 1Linked List · HashMapLeetCode:&#35;138

Deep copy a linked list where each node has a next and a random pointer (which may point to any node or null).

Input:  [[7,null],[13,0],[11,4],[10,2],[1,0]]
Output: deep copy with same structure

Approach: Two passes with a HashMap. Pass 1: create all new nodes and map original → clone. Pass 2: set clone.next = map[original.next] and clone.random = map[original.random].

Complexity: Time O(n) · Space O(n)

Follow-up: O(1) space solution — interleave cloned nodes between originals, then separate.


13. Flood Fill Easy

Round 1DFS · Matrix · Adobe DomainLeetCode:&#35;733

Given an image as a 2D array, a starting pixel (sr, sc), and a new colour, perform a flood fill — change the colour of all pixels connected to the start pixel that share the original colour.

Input:  image = [[1,1,1],[1,1,0],[1,0,1]], sr=1, sc=1, color=2
Output: [[2,2,2],[2,2,0],[2,0,1]]

Approach: DFS from (sr, sc). Change colour and recurse into 4 neighbours with the same original colour. Guard against the case where newColor == originalColor to avoid infinite recursion.

Complexity: Time O(m·n) · Space O(m·n)

Follow-up: This is the core of Adobe Photoshop's paint bucket tool — discuss how you'd optimise it for large images (scanline fill, GPU-parallel fill).


Part 3 — Onsite Technical Rounds (Rounds 2 and 3)

These appear in Adobe's deeper technical rounds. Expect harder DSA, OOP design problems, and Adobe-domain questions. C++ knowledge is tested explicitly in MTS rounds.


14. LRU Cache Medium

OnsiteDesign · HashMap · Doubly Linked ListLeetCode:&#35;146

Design a data structure implementing Least Recently Used (LRU) cache eviction. Both get(key) and put(key, value) must run in O(1).

LRUCache cache(2);
cache.put(1,1); cache.put(2,2);
cache.get(1);    // 1
cache.put(3,3);  // evicts key 2
cache.get(2);    // -1

Approach: Combine a HashMap (O(1) lookup) with a doubly linked list (O(1) insert/delete). On every get/put, move the node to the head. On capacity overflow, remove the tail.

Complexity: Time O(1) · Space O(capacity)

Follow-up: LFU Cache (LeetCode 460 — evict least frequently used, with LRU tiebreak).


15. Text Justification Hard

OnsiteGreedy · Strings · Adobe DomainLeetCode:&#35;68

Given an array of words and a line width maxWidth, format the text so each line has exactly maxWidth characters and is fully left-justified (extra spaces distributed evenly between words; last line is left-justified).

Input:  words = ["What","must","be","acknowledgment","shall","be"], maxWidth = 16
Output: ["What   must  be", "acknowledgment  ", "shall be        "]

Approach: Greedy line packing. For each line, greedily pack as many words as fit. Distribute extra spaces: extra / (gaps) for each gap, with extra % gaps leftmost gaps getting one more. Last line is left-justified.

Complexity: Time O(n·L) · Space O(maxWidth)

Follow-up: This is directly related to Adobe's document layout engine — discuss how you'd handle different font widths (proportional fonts).


16. Binary Tree Maximum Path Sum Hard

OnsiteTrees · DFS · DPLeetCode:&#35;124

Find the maximum path sum in a binary tree. The path can start and end at any node and need not pass through the root.

Input:  root = [-10,9,20,null,null,15,7]
Output: 42  (15 + 20 + 7)

Approach: Post-order DFS. At each node, compute max gain from left and right subtrees (ignore negatives — take 0). Update global max with node.val + left_gain + right_gain. Return node.val + max(left, right) to parent.

Complexity: Time O(n) · Space O(h)

Follow-up: Path sum with exactly k nodes — add depth constraint to the DFS.


17. Word Ladder Hard

OnsiteBFS · Graphs · StringsLeetCode:&#35;127

Given beginWord, endWord, and a word list, find the shortest transformation sequence (each step changes exactly one letter and must be in the word list).

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

Approach: BFS where each node is a word. For each word, try all 26-letter substitutions at every position — if the result is in the word set, add it to the queue. Return level when endWord is reached.

Complexity: Time O(M²·N) where M = word length, N = word count · Space O(M²·N)

Follow-up: Bidirectional BFS halves the search space significantly.


18. Edit Distance Medium

OnsiteDynamic Programming · StringsLeetCode:&#35;72

Find the minimum number of insert, delete, or replace operations to convert string word1 to word2.

Input:  word1 = "horse", word2 = "ros"
Output: 3  (horse→rorse→rose→ros)

Approach: 2-D DP. If s1[i]==s2[j]: dp[i][j]=dp[i-1][j-1]. Else: 1 + min(dp[i-1][j], dp[i][j-1], dp[i-1][j-1]).

Complexity: Time O(m·n) · Space O(m·n), optimisable to O(min(m,n)).

Follow-up: What operations did you perform? (Backtrack through the DP table.)


19. Largest Rectangle in Histogram Hard

OnsiteMonotonic Stack · ArraysLeetCode:&#35;84

Find the area of the largest rectangle that fits in a histogram.

Input:  heights = [2,1,5,6,2,3]
Output: 10

Approach: Monotonic increasing stack. For each bar, pop all taller bars when a shorter bar is encountered. Width of popped bar extends from its new stack top to the current index.

Complexity: Time O(n) · Space O(n)

Follow-up: Maximal Rectangle in binary matrix (LeetCode 85 — apply histogram solution row by row).


20. 3Sum Medium

OnsiteTwo Pointers · SortingLeetCode:&#35;15

Find all unique triplets in the array that sum to zero.

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

Approach: Sort the array. For each element i, use two pointers left = i+1, right = n-1. Move pointers based on sum. Skip duplicates at both i and pointer positions.

Complexity: Time O(n²) · Space O(1)

Follow-up: 4Sum (LeetCode 18 — add one more outer loop, same two-pointer inner).


21. Course Schedule (Cycle Detection) Medium

OnsiteGraphs · Topological Sort · DFSLeetCode:&#35;207

Given prerequisites as a directed graph, determine if you can finish all courses (no cycle exists).

Input:  numCourses = 2, prerequisites = [[1,0],[0,1]]
Output: false  (circular dependency)

Approach: DFS with 3-colour marking (white/grey/black). If DFS hits a grey node, cycle exists. Alternatively Kahn's BFS — if processed count < numCourses, cycle exists.

Complexity: Time O(V+E) · Space O(V)

Follow-up: Return valid course order if no cycle (LeetCode 210 — topological sort output).


22. Implement Trie (Prefix Tree) Medium

OnsiteDesign · Trie · StringsLeetCode:&#35;208

Implement a Trie with insert(word), search(word), and startsWith(prefix) operations.

Trie trie = new Trie();
trie.insert("apple");
trie.search("apple");   // true
trie.startsWith("app"); // true
trie.search("app");     // false

Approach: Each TrieNode holds an array of 26 children and a boolean isEnd. Insert: walk/create nodes for each character. Search: walk and check isEnd. Prefix: walk and return true if path exists.

Complexity: Time O(L) per operation · Space O(total_chars)

Follow-up: Word Search II — find all words from a dictionary in a grid (LeetCode 212 — DFS + Trie for pruning).


23. Minimum Window Substring Hard

OnsiteSliding Window · HashMapLeetCode:&#35;76

Find the minimum window in s that contains all characters of t.

Input:  s = "ADOBECODEBANC", t = "ABC"
Output: "BANC"

Approach: Sliding window. Expand right until window is valid. Contract left while still valid — track minimum window length.

Complexity: Time O(|s|+|t|) · Space O(|t|)

Follow-up: What if we need the minimum window subsequence (characters in order)? (LeetCode 727.)


24. Merge K Sorted Lists Hard

OnsiteLinked List · Min-Heap · Divide & ConquerLeetCode:&#35;23

Merge k sorted linked lists into one sorted list.

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

Approach: Min-heap of size k — push head of each list. Pop minimum, append to result, push its next node. Alternatively, divide and conquer (merge pairs) in O(N log k).

Complexity: Heap: Time O(N log k) · Space O(k)

Follow-up: What if lists are infinite streams? (Min-heap approach works — just keep consuming.)


25. Container With Most Water Medium

OnsiteTwo Pointers · ArraysLeetCode:&#35;11

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

Approach: Two pointers from both ends. Area = min(height[l], height[r]) × (r - l). Move the pointer with the smaller height inward.

Complexity: Time O(n) · Space O(1)

Follow-up: Trapping Rain Water (LeetCode 42 — sum of water trapped per bar, not just maximum container).


26. Reverse Nodes in K-Group Hard

OnsiteLinked List · RecursionLeetCode:&#35;25

Given a linked list, reverse every k nodes as a group. If remaining nodes are fewer than k, leave them as is.

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

Approach: Count k nodes. If available, reverse them in-place and recursively handle the rest. Connect the reversed group to the result of the recursive call.

Complexity: Time O(n) · Space O(n/k) recursion depth

Follow-up: Do this iteratively to reduce space to O(1).


27. Coin Change Medium

OnsiteDynamic Programming · BFSLeetCode:&#35;322

Given coin denominations and a target amount, find the minimum number of coins to make the amount.

Input:  coins = [1,5,6,9], amount = 11
Output: 2  (5+6)

Approach: Bottom-up DP. dp[0]=0, dp[i] = min(dp[i], dp[i-coin]+1) for each coin ≤ i.

Complexity: Time O(n·amount) · Space O(amount)

Follow-up: Count total ways to make the amount (Coin Change 2 — LeetCode 518).


28. Longest Increasing Subsequence Medium

OnsiteDynamic Programming · Binary SearchLeetCode:&#35;300

Find the length of the longest strictly increasing subsequence.

Input:  nums = [10,9,2,5,3,7,101,18]
Output: 4  ([2,3,7,101])

Approach (O(n log n)): Maintain a tails array. For each element, binary search for its position in tails and replace. Length of tails = LIS length.

Complexity: Time O(n log n) · Space O(n)

Follow-up: Return the actual subsequence (backtrack using a parent array).


29. Zigzag Traversal of Binary Tree Medium

OnsiteBFS · Trees · DequeLeetCode:&#35;103

Return the zigzag level order traversal of a binary tree (alternate left-to-right and right-to-left per level).

Input:  root = [3,9,20,null,null,15,7]
Output: [[3],[20,9],[15,7]]

Approach: BFS with a direction flag. Even levels: append normally. Odd levels: use deque and appendleft, or reverse the level list.

Complexity: Time O(n) · Space O(n)

Follow-up: Vertical order traversal of binary tree (LeetCode 987 — sort by column then row).


30. Decode String Medium

OnsiteStack · Strings · Adobe DomainLeetCode:&#35;394

Decode a string encoded as k[encoded_string] — repeat the enclosed string k times, handling nested encodings.

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

Approach: Use two stacks — one for counts, one for strings. On [: push current count and current string. On ]: pop count and previous string, append current string repeated count times.

Complexity: Time O(output length) · Space O(depth)

Follow-up: This is directly related to Adobe's document encoding — nested styles, embedded objects in PDFs.


31. Trapping Rain Water Hard

OnsiteTwo Pointers · StackLeetCode:&#35;42

Compute how much water can be trapped between elevation bars after rain.

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

Approach: Two pointers. Track left_max and right_max. Move the pointer with the smaller max — water at that position = max − height[pointer].

Complexity: Time O(n) · Space O(1)

Follow-up: Trapping Rain Water II in 3D grid (LeetCode 407 — min-heap BFS from borders inward).


32. Serialize and Deserialize Binary Tree Hard

OnsiteTrees · DFS · Design · Adobe DomainLeetCode:&#35;297

Design an algorithm to serialize a binary tree to a string and deserialize it back to the original tree.

Input:  root = [1,2,3,null,null,4,5]
Output: serialize then deserialize returns original tree

Approach: Pre-order DFS serialisation — write node values separated by commas, use "null" for missing nodes. Deserialisation reads values from a queue and recursively rebuilds.

Complexity: Time O(n) · Space O(n)

Follow-up: This is directly related to Adobe's PDF/document serialisation — discuss how structure is preserved across save/load cycles.


33. Find Median from Data Stream Hard

OnsiteHeap · DesignLeetCode:&#35;295

Design a data structure that supports addNum(int num) and findMedian() operations on a running stream.

MedianFinder mf;
mf.addNum(1); mf.addNum(2);
mf.findMedian(); // 1.5
mf.addNum(3);
mf.findMedian(); // 2.0

Approach: Two heaps — a max-heap for the lower half, a min-heap for the upper half. Keep them balanced (size difference ≤ 1). Median = top of the larger heap or average of both tops.

Complexity: Time O(log n) add · O(1) median · Space O(n)

Follow-up: Sliding window median (LeetCode 480 — two heaps with lazy deletion).


34. Subsets Medium

OnsiteBacktracking · Bit ManipulationLeetCode:&#35;78

Return all possible subsets (power set) of a unique integer array.

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

Approach: Backtracking — at each index include or exclude the element. Alternatively iterate over all 2^n bitmasks.

Complexity: Time O(n·2^n) · Space O(n)

Follow-up: Subsets II with duplicates (LeetCode 90 — sort first, skip duplicates at same recursion level).


35. Generate Parentheses Medium

OnsiteBacktracking · RecursionLeetCode:&#35;22

Generate all combinations of n pairs of well-formed parentheses.

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

Approach: Backtracking. Add ( if open count < n. Add ) if close count < open count. Base case: when both counts equal n.

Complexity: Time O(4^n / √n) (Catalan number) · Space O(n)

Follow-up: Count only — return the nth Catalan number C(n) = (2n)! / ((n+1)!·n!).


36. Sort Colors (Dutch National Flag) Medium

OnsiteThree Pointers · SortingLeetCode:&#35;75

Sort an array of 0s, 1s, and 2s in-place — one pass, O(1) space.

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

Approach: Dutch National Flag. Pointers low=0, mid=0, high=n-1. If nums[mid]==0: swap with low, advance both. If 1: advance mid. If 2: swap with high, decrement high.

Complexity: Time O(n) · Space O(1)

Follow-up: 4-colour sort — extend with two additional boundary pointers.


37. Next Greater Element II (Circular Array) Medium

OnsiteMonotonic Stack · ArraysLeetCode:&#35;503

In a circular integer array, find the next greater element for each element (-1 if none exists).

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

Approach: Monotonic decreasing stack. Iterate 2n times using i % n. Push indices; for each element pop all smaller elements from stack and set their answer.

Complexity: Time O(n) · Space O(n)

Follow-up: Daily Temperatures (LeetCode 739 — same monotonic stack, store days until warmer).


38. Kth Largest Element Medium

OnsiteHeap · QuickselectLeetCode:&#35;215

Find the kth largest element in an unsorted array.

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

Approach: Min-heap of size k. Push each element; if heap size > k pop the smallest. Heap top = answer. Alternatively quickselect for O(n) average.

Complexity: Heap: O(n log k) · Quickselect: O(n) avg

Follow-up: Kth smallest in a sorted matrix (LeetCode 378 — binary search on value range).


39. Product of Array Except Self Medium

OnsiteArrays · Prefix ProductsLeetCode:&#35;238

Return an array where each element is the product of all other elements. No division allowed, O(n) time.

Input:  nums = [1,2,3,4]
Output: [24,12,8,6]

Approach: Two passes. First pass fills prefix products. Second pass multiplies from the right using a running suffix product variable.

Complexity: Time O(n) · Space O(1) excluding output

Follow-up: What if there are zeros? (Count zeros: if >1 all outputs are 0; if exactly 1 only the zero-position gets the total product.)


40. Word Break Medium

OnsiteDynamic Programming · TrieLeetCode:&#35;139

Determine if string s can be segmented into words from a dictionary.

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

Approach: DP. dp[i] = true if s[0..i-1] can be segmented. For each i, check all j < i: if dp[j] and s[j..i-1] is in dictionary, dp[i] = true.

Complexity: Time O(n²) · Space O(n)

Follow-up: Return all possible segmentations (LeetCode 140 — backtracking with memoization).


41. Matrix Row with Maximum 1s Medium

OnsiteBinary Search · Matrix

Given a row-wise sorted binary matrix (all 0s come before 1s in each row), find the row with the maximum number of 1s.

Input:  [[0,1,1,1],[0,0,1,1],[1,1,1,1],[0,0,0,0]]
Output: 2  (row index, 4 ones)

Approach: Start from top-right corner. If cell is 1, move left (this row has more 1s — update answer). If 0, move down. Each step moves left or down — O(m+n) total.

Complexity: Time O(m+n) · Space O(1)

Follow-up: Use binary search per row for O(m log n) — useful when m is small but n is large.


42. Sorted Array to Balanced BST Easy

OnsiteTrees · Divide & ConquerLeetCode:&#35;108

Convert a sorted array into a height-balanced BST.

Input:  nums = [-10,-3,0,5,9]
Output: [0,-3,9,-10,null,5]

Approach: Divide and conquer. Pick the middle element as root. Recursively build left subtree from the left half and right subtree from the right half.

Complexity: Time O(n) · Space O(log n)

Follow-up: Convert sorted linked list to BST (LeetCode 109 — find middle using slow/fast pointers).


43. Implement Queue Using Two Stacks Easy

OnsiteStack · DesignLeetCode:&#35;232

Implement a first-in-first-out queue using only two stacks.

MyQueue q;
q.push(1); q.push(2);
q.peek();  // 1
q.pop();   // 1
q.empty(); // false

Approach: inbox stack for pushes, outbox stack for pops. When outbox is empty, pour all inbox into outbox (reverses order). Amortised O(1) per operation.

Complexity: Amortised O(1) · Space O(n)

Follow-up: Implement a stack using two queues (LeetCode 225 — push to the second queue then swap).


44. Pow(x, n) Medium

OnsiteMath · Recursion · Divide & ConquerLeetCode:&#35;50

Implement pow(x, n) including negative n.

Input:  x = 2.0, n = -2
Output: 0.25

Approach: Fast exponentiation. Even n: pow(x*x, n/2). Odd n: x * pow(x, n-1). Negative n: pow(1/x, -n). Handle n = INT_MIN overflow by casting to long.

Complexity: Time O(log n) · Space O(log n)

Follow-up: Matrix exponentiation — raise a 2×2 matrix to the nth power for Fibonacci in O(log n).


45. Image Similarity / Same Image Check Medium

OnsiteMatrix · Hashing · Adobe Domain

Given two 2D image matrices, determine if they are identical after any number of 90-degree rotations and/or horizontal/vertical flips.

Input:  img1 = [[1,0],[0,1]], img2 = [[1,0],[0,1]]
Output: true

Input:  img1 = [[1,2],[3,4]], img2 = [[2,1],[4,3]]
Output: true  (horizontal flip)

Approach: Generate all 8 transformations of img1 (4 rotations × 2 flips). Compare each against img2. A 90° rotation transforms matrix[i][j]matrix[n-1-j][i].

Complexity: Time O(8·m·n) · Space O(m·n)

Follow-up: This is the foundation of Adobe Photoshop's image transformation engine — discuss GPU parallelisation for large images.


46. Minimum Steps to Reach Target in Grid with Obstacles Medium

OnsiteBFS · Matrix · Shortest PathLeetCode:&#35;1091

In an n×n binary matrix, find the length of the shortest clear path from top-left to bottom-right (8-directional movement, 0=open, 1=blocked).

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

Approach: BFS from (0,0). Explore all 8 directions. Track visited cells. Return level when (n-1, n-1) is reached, or -1 if not reachable.

Complexity: Time O(n²) · Space O(n²)

Follow-up: Shortest path removing at most k obstacles (LeetCode 1293 — BFS with state (r, c, k_remaining)).


47. 0/1 Knapsack Medium

OnsiteDynamic Programming · Classic

Given items with weights and values, and a bag of capacity W, find the maximum value achievable without exceeding the weight.

Input:  weights=[1,3,4,5], values=[1,4,5,7], W=7
Output: 9  (items with weight 3 and 4, values 4+5)

Approach: 2-D DP where dp[i][w] = max value using first i items with weight limit w. dp[i][w] = max(dp[i-1][w], dp[i-1][w-wt[i]] + val[i]). Space-optimise to 1-D by iterating w backwards.

Complexity: Time O(n·W) · Space O(W)

Follow-up: Fractional knapsack (greedy — take items sorted by value/weight ratio). Unbounded knapsack (items can be reused — iterate w forwards).


48. Count Pairs of Similar Strings Easy

OnsiteHashMap · Bit Masking · StringsLeetCode:&#35;2506

Two strings are similar if they consist of the same set of characters. Count the number of similar pairs in an array of strings.

Input:  words = ["aba","aabb","abcd","bac","aabc"]
Output: 2

Approach: Represent each word as a bitmask of 26 bits (bit i set if character i appears). Use a HashMap to count frequency of each bitmask. For each group of size k, add k*(k-1)/2 pairs.

Complexity: Time O(n·L) · Space O(n)

Follow-up: What if similarity is defined by anagram (same characters with same frequency)? Use a sorted string as the key instead of a bitmask.


49. Logger Rate Limiter Easy

OnsiteDesign · HashMap · Adobe DomainLeetCode:&#35;359

Design a logger system that receives a stream of messages with timestamps and allows printing a message only if it has not been printed in the last 10 seconds.

Logger logger;
logger.shouldPrintMessage(1, "foo");   // true
logger.shouldPrintMessage(2, "bar");   // true
logger.shouldPrintMessage(3, "foo");   // false (within 10s)
logger.shouldPrintMessage(11, "foo");  // true

Approach: HashMap storing message → last_print_timestamp. On each call, if message not in map or timestamp - last_time >= 10, print and update map.

Complexity: Time O(1) · Space O(n) unique messages

Follow-up: Memory-efficient version — sliding window with a queue that evicts old messages (useful when the number of unique messages is very large).


50. Design Adobe Document Versioning (Undo/Redo) Hard

OnsiteDesign · OOP · Stacks · Adobe Domain

Design an undo/redo system for a document editor (like Adobe Acrobat or Illustrator). The system must support: execute(command), undo(), redo(), and getState().

Design:
  Command interface: { execute(), undo() }
  UndoRedoManager {
    undoStack: Stack<Command>
    redoStack: Stack<Command>
    execute(cmd): cmd.execute(), push to undoStack, clear redoStack
    undo(): pop from undoStack, cmd.undo(), push to redoStack
    redo(): pop from redoStack, cmd.execute(), push to undoStack
  }

Approach: Command design pattern. Each action is encapsulated as a Command object with execute() and undo() methods. Two stacks manage the history. Executing a new command after undo clears the redo stack.

Complexity: Time O(1) per operation · Space O(history_size)

Follow-up: How do you handle composite commands (macro operations that bundle multiple atomic commands)? (Composite Command pattern — a list of commands treated as a single command.)


Adobe Interview Preparation Tips

  • C++ is expected for MTS roles: Unlike most product companies, Adobe explicitly tests C++ knowledge — STL containers (map, unordered_map, priority_queue, set), smart pointers, virtual functions, templates, and memory management. Practice writing C++ specifically.
  • Code quality is rated: Adobe interviewers score on code readability, variable naming, null/edge-case handling, and modularisation — not just correctness. Treat every solution as production code.
  • Adobe domain context: Expect at least one question per round that has a creative/document context. Flood Fill is the paint bucket tool. Text Justification is the document layout engine. Decode String relates to nested document structures. Relate your answers to real Adobe products — it signals domain awareness.
  • Design questions start in Round 2: LRU Cache, Rate Limiter, Undo/Redo, and Logger are standard design questions for MTS-1 and MTS-2. Know the HashMap + Doubly Linked List pattern cold.
  • OA has an MCQ section: The online assessment sometimes includes 45 MCQ questions on C/C++ output prediction, time complexity analysis, and data structure properties. Practice reading small C++ snippets and predicting exact output — pointer arithmetic, pre/post increment, sizeof, and virtual dispatch are common.
  • Behavioural rounds are structured: Adobe uses STAR format strictly. Prepare 3–4 stories around ownership, cross-team impact, handling ambiguity, and mentorship.