Reported March 2024
Googlegreedy

Mnimize Total Time

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

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

Google's March 2024 OA included a scheduling or optimization problem where you need to minimize total time. This is a common Google pattern: looks straightforward on the surface, but the trick is usually greedy ordering or a heap-based simulation. You're not writing a complex DP solution. You're finding the right order to process tasks or events. If you blank on the exact approach, StealthCoder will read the problem constraints and feed you the pattern in real time.

Pattern and pitfall

Minimize Total Time problems almost always hinge on greedy choice: sort by some metric (deadline, duration, weight), then simulate the outcome. If there are priorities or variable costs, a min-heap tracks the next best action. The pitfall is assuming you need DP or trying to brute-force permutations. Google wants to see if you can recognize that order matters and that a single pass with the right comparator solves it. If the problem involves concurrent tasks or weighted scheduling, the trick is often: process shortest-job-first or sort by deadline. When you're stuck live, StealthCoder will extract the constraints and hand you the greedy invariant you're missing.

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 Mnimize Total Time 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

⏵ Practice the LeetCode equivalent

This OA pattern shows up on LeetCode as task scheduler. If you have time before the OA, drill that.

⏵ The honest play

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

Google 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.

Mnimize Total Time FAQ

Is this a greedy problem or dynamic programming?+

Almost certainly greedy. Google rarely asks DP on this surface. The trick is the sort order: deadline, duration, or some ratio. If it feels like you need to compare all permutations, you're off the track. Step back and ask what invariant a single pass preserves.

What if there are multiple tasks running in parallel?+

Use a min-heap to track which task finishes next. Pop, process, push the result back. The heap keeps you from recalculating the global minimum every time. This is O(n log n) instead of O(n^2).

How do I know which property to sort by?+

Read the cost function carefully. If total time is the sum of finish times, sort by duration ascending. If it's weighted, sort by weight-to-duration ratio. The problem statement will hint at the metric that minimizes the sum.

Will I need to implement a custom comparator?+

Yes, likely. Know how to write one in your language. For Python, use a lambda in sorted() or a key parameter. For Java, implement Comparator. This is table stakes for Google.

Can I solve this in 48 hours of cramming?+

Yes. Memorize the greedy patterns: shortest-job-first, earliest-deadline-first, and ratio-based sorting. Do three similar problems on LeetCode (Task Scheduler, Reorganize String, etc.) and you'll recognize the shape immediately.

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

OA at Google?
Invisible during screen share
Get it