Reported February 2024
Adobebreadth first search

Get Minimum Operations

Reported by candidates from Adobe's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.

Get StealthCoderRuns invisibly during the live Adobe OA. Under 2s to a working solution.
Founder's read

Adobe threw this at candidates in February 2024, and it's a straightforward optimization problem disguised as a counting exercise. You're asked to find the minimum number of operations needed to reach a goal state, which means you're either doing BFS to explore all states or finding a mathematical shortcut. The trick is recognizing whether brute force will TLE or if there's a pattern that lets you skip most of the search space. StealthCoder will catch the pattern in real time if you blank on the approach.

Pattern and pitfall

Minimum operations problems almost always live in one of two camps: graph traversal (BFS to find shortest path in state space) or math (recognizing that operations follow a formula or greedy pattern). Without the exact problem text, the most common Adobe variant involves either reducing a number to 1 through division/subtraction or building a number up through multiplication/addition. The key is always the same: model each operation as a state transition, then find the shortest path. BFS guarantees the minimum. The pitfall is trying to greedy without proof, or iterating naively when memoization or math would cut runtime from exponential to linear. When you sit down live, StealthCoder will read the problem and flag whether this is a classic BFS or if there's a closed-form solution.

Drill it cold or hedge it with StealthCoder. Either way, don't walk into the OA hoping you remember the trick.

If this hits your live OA

You can drill Get Minimum Operations cold, or you can hedge it. StealthCoder runs invisibly during screen share and surfaces a working solution in under 2 seconds. The proctor sees the IDE. They don't see what's behind it. Made for the candidate who got the OA invite this morning and has 72 hours, not six months.

Get StealthCoder

Related leaked OAs

⏵ Practice the LeetCode equivalent

This OA pattern shows up on LeetCode as minimum genetic mutation. If you have time before the OA, drill that.

⏵ The honest play

You've seen the question. Make sure you actually pass Adobe's OA.

Adobe reuses patterns across OAs. Made for the candidate who got the OA invite this morning and has 72 hours, not six months. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Get Minimum Operations FAQ

Is this asking me to find a sequence or just count operations?+

Just count. You need to return the minimum number of steps, not the path itself. That's why BFS works so cleanly here. Most candidates over-engineer and try to track the actual sequence. Don't. Keep a visited set and a queue of (state, depth) tuples.

What if I can't figure out the pattern in the first 10 minutes?+

Start with BFS. It's the safe bet. Initialize a queue with your starting state, mark it visited, and expand level by level. If it passes the examples fast, you're good. If it times out, the problem likely has a math trick. That's when you look for divisibility patterns or greedy rules.

How do I know if a greedy approach will work?+

Greedy only works if every local choice is optimal. For operations problems, that's rarely true without proof. For example, if you can divide by 2 or subtract 1, dividing isn't always best. Use BFS first, then optimize if needed. Don't guess greedy under time pressure.

Will this require memoization or is plain BFS enough?+

Plain BFS with a visited set is usually sufficient. The state space is finite and bounded by the goal. If you're using DFS with recursion, memoization helps avoid recomputing subtrees. But BFS is simpler and often faster for minimum operations problems.

What should I check before submitting?+

Edge cases: goal equals start state (return 0), goal is unreachable (return -1 if applicable), and single-step solutions. Verify your visited set prevents infinite loops. Run through the examples by hand. If BFS passes all examples in under 2 seconds, you're probably correct.

Problem reported by candidates from a real Online Assessment. Sourced from a publicly-available candidate-aggregated repository. Not affiliated with Adobe.

OA at Adobe?
Invisible during screen share
Get it