Reported February 2024
Flexportbinary search

Get Min Time

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

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

Flexport hit you with 'Get Min Time' in February, and you're staring at a blank problem statement. This one's a optimization puzzle where you're finding the minimum time to complete some task or reach a state. It's the kind of problem that looks simple until you realize the greedy approach fails and you need dynamic programming or binary search. StealthCoder will catch the pattern if you blank on the approach, but knowing the shape now means you walk in confident.

Pattern and pitfall

Get Min Time is almost always a search or DP problem. You're either binary searching on the answer (if you can verify a time T works in polynomial time) or building up minimum times bottom-up. The trap: candidates assume greedy, pick the locally optimal choice at each step, and fail test cases. The real trick is recognizing you need to explore the decision space systematically. If there are multiple agents or resources that can work in parallel, you're likely binary searching on the bottleneck time. If it's sequential decisions, you're memoizing subproblems. StealthCoder covers both patterns live, but sketch the recurrence or search bounds on your whiteboard first.

The honest play: practice the pattern, and have StealthCoder ready for the one you didn't see coming.

If this hits your live OA

You can drill Get Min 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. Built for the candidate who saw this exact problem leak two days before his OA and wondered if anyone had a play.

Get StealthCoder

Related leaked OAs

⏵ Practice the LeetCode equivalent

This OA pattern shows up on LeetCode as minimum time to complete all tasks. If you have time before the OA, drill that.

⏵ The honest play

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

Flexport reuses patterns across OAs. Built for the candidate who saw this exact problem leak two days before his OA and wondered if anyone had a play. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Get Min Time FAQ

Is this greedy or DP?+

Usually neither alone. It's binary search on the answer (check if time T is feasible) or DP with memoization (minimum time to reach state X). Greedy fails because local picks don't guarantee global minimum. Test the small examples by hand to see if order matters.

What's the most common pitfall?+

Assuming you can process tasks sequentially and picking the shortest first. Real catch: tasks may run in parallel or have dependencies. Read the constraints carefully. If multiple workers or threads exist, it's almost always binary search on total time.

How do I verify a time in binary search?+

Write a helper that takes a candidate time T and returns true if you can complete all tasks by time T. This is usually a greedy simulation: assign tasks to workers in order, use whoever finishes first. If simulation fits all tasks, T works.

What's the search space?+

Lower bound: maximum single task time. Upper bound: sum of all task times (worst case, one worker). Binary search between them. Usually 30-50 iterations to converge, very fast.

Can I solve this in 48 hours without prep?+

Yes. Recognize the optimization shape, code a feasibility check, and binary search the answer. If that fails, pivot to DP with a state like dp[tasks_done] = min_time. Both patterns are standard and your IDE autocomplete will help.

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

OA at Flexport?
Invisible during screen share
Get it