Reported September 2026
Superhumandynamic programming

Minimum Time on Two Processors

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

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

Superhuman reportedly served this one in September 2026, and the detail that matters is in the statement: every file is indivisible and goes to exactly one of two processors. That kills any greedy split and points straight at a subset-sum style DP. You're handed sizes, two per-unit speeds, and a finish time of max(sumA * timeA, sumB * timeB). If you've got an OA coming up, this is a partition problem wearing a scheduling costume. StealthCoder sits invisible on your screen as a safety net if the DP state blanks on you mid-assessment, but the idea is short enough to hold in your head.

The problem

You are given an integer array data, where data[i] is the size of one indivisible data file. Every file must be assigned to exactly one of two processors.
Processor A needs processTimeA seconds for each unit of data, and Processor B needs processTimeB seconds for each unit. The two processors work in parallel.
If the total data assigned to A is sumA and the total assigned to B is sumB, all work finishes after max(sumA * processTimeA, sumB * processTimeB) seconds.
Return the minimum possible finishing time over all file assignments.

Function
getMinProcessingTime(data: int[], processTimeA: int, processTimeB: int) → int

Examples
Example 1
data = [4,4,6,2,5]
processTimeA = 3
processTimeB = 2
return = 26
Assign the two files of size 4 to A for 24 seconds. Assign 6, 2, and 5 to B for 26 seconds. The finishing time is 26.
Example 2
data = [5,5]
processTimeA = 1
processTimeB = 1
return = 5
Assign one file to each processor, so both finish after 5 seconds.

Constraints
1 <= data.length <= 100
1 <= data[i] <= 10^3
1 <= processTimeA, processTimeB <= 10^3

Reported by candidates. Source: FastPrep

Pattern and pitfall

The trick: total = sum(data) is fixed, so choosing sumA fixes sumB = total - sumA. Build a boolean subset-sum table over reachable sumA values. Max total is 100 * 1000 = 100000, and 100 files makes about 10^7 operations, which is fine. Then loop over every reachable s, compute max(s * processTimeA, (total - s) * processTimeB), and keep the minimum. A 1D boolean array iterated downward works, and a Python big-int bitset (reach |= reach << x) is even shorter. The pitfalls: sorting and greedily assigning to the faster machine fails because files are indivisible. Forgetting that sumA can be 0 or total is another one. Also don't split by dividing total evenly, since the speeds differ. Check example 1: sumA = 8 gives max(24, 26) = 26. If the DP shape escapes you live, StealthCoder is the hedge, but the reachable-sums loop is the whole solution.

If this hits your live OA and you blank, StealthCoder solves it in seconds, invisible to the proctor.

If this hits your live OA

You can drill Minimum Time on Two Processors 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. Built by an Amazon engineer who would have shipped this the night before his JPMorgan OA if he'd had it.

Get StealthCoder

Related leaked OAs

⏵ The honest play

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

Superhuman reuses patterns across OAs. Built by an Amazon engineer who would have shipped this the night before his JPMorgan OA if he'd had it. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Minimum Time on Two Processors FAQ

What's the trick in Minimum Time on Two Processors?+

Since total data is fixed, picking sumA determines sumB. Compute every reachable subset sum of the files with a boolean DP, then evaluate max(sumA * processTimeA, sumB * processTimeB) for each and take the minimum. It's subset sum plus a final scan.

Why doesn't a greedy assignment work here?+

Files can't be split. Giving each file to whichever processor finishes sooner can lock you into a bad partition, the same way greedy fails on number partitioning. Example 1 shows it: the optimal split puts the two 4s on A, which a local choice may miss.

What's the time and space complexity?+

With n up to 100 and values up to 1000, total is at most 100000. The DP is O(n * total), roughly 10^7 steps, and space is O(total) with a 1D array iterated backward. A bitset shift cuts the constant a lot.

Is this a common pattern in OAs like Superhuman's?+

Yes. Partition and subset-sum DP show up often in scheduling or load-balancing wording. Superhuman reportedly asked this in September 2026. Recognize 'indivisible items into two groups' and you can map it to subset sum quickly.

How do I prepare for this in 48 hours?+

Write the 1D subset-sum DP from memory twice, including the backward loop. Then practice the final step: scanning reachable sums and minimizing a max of two costs. Test on both examples and edge cases like one file, or very different processor speeds.

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

OA at Superhuman?
Invisible during screen share
Get it