Reported March 2024
Salesforcesimulation

Plan Cut

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

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

Salesforce's Plan Cut problem hit the OA circuit in March 2024 and it's a simulation wrapped in a greedy decision layer. You're given some kind of resource or schedule that needs to be partitioned or reduced, and the naive approach of just cutting from one end won't work. The trick is figuring out which cuts minimize waste or maximize some outcome. StealthCoder will read the problem statement live and surface the pattern in seconds if you blank on what the optimal strategy actually is.

Pattern and pitfall

Plan Cut is fundamentally about making sequential decisions that affect downstream state. You'll need to model the problem as a sequence of choices where each choice constrains the next, then either greedily pick the locally optimal move or recognize that you need dynamic programming to avoid getting trapped in a suboptimal path. The common miss is assuming a single linear scan works; most candidates don't account for how one cut affects future cuts. The pattern is almost always simulation plus greedy or DP depending on whether you can prove the greedy choice is globally optimal. Have StealthCoder as your safety net to validate the approach before you code.

Memorize the pattern. If you can't, run StealthCoder. The proctor sees the IDE. They don't see what's behind it.

If this hits your live OA

You can drill Plan Cut 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 by an engineer who treats the OA as theater. If yours is tonight, you don't have time to grind. You have time to hedge.

Get StealthCoder

Related leaked OAs

⏵ The honest play

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

Salesforce reuses patterns across OAs. Made by an engineer who treats the OA as theater. If yours is tonight, you don't have time to grind. You have time to hedge. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Plan Cut FAQ

Is Plan Cut a dynamic programming problem?+

Not necessarily. It's simulation first. You might be able to solve it greedily if you can prove that each local optimal choice leads to a global optimum. If greedy fails in examples, switch to memoized recursion or bottom-up DP to explore all cut sequences.

What's the most common mistake on this problem?+

Assuming a single pass through the input works. Plan Cut usually requires you to model interdependencies between cuts. Missing that leads to wrong output on hidden tests. Trace through the examples carefully to see how one cut affects the next.

How do I know if I should cut from the start or the end?+

The problem text will define what 'cutting' means and what you're optimizing for. Read it exactly. Then test both directions on the examples. If one direction is clearly better, it's a hint about the intended solution path.

Can I solve this in 15 minutes if I recognize the pattern?+

Yes, if you see it's greedy and can code a single scan with bookkeeping. If it's DP, you need another 10-15 minutes to write the recurrence and memoization. Expect 20-30 minutes total if you're confident.

Should I optimize for time or just get it working?+

Get it working first. Trace examples by hand, write the logic, test. Salesforce's time limits are usually generous for correct logic. Premature optimization on a sim problem is a trap.

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

OA at Salesforce?
Invisible during screen share
Get it