Reported February 2024
Googlesimulation

Maximum 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 Maximum Time problem hits candidates in February with a deceptively simple premise: given a string of digits and colons, find the largest valid time you can form by rearranging the digits. You've got 24-72 hours before the OA and you need the pattern locked down. This is a brute-force enumeration problem wrapped in a constraint-satisfaction trick. StealthCoder can be your safety net if the logic slips under pressure, but the core move is straightforward once you see it.

Pattern and pitfall

The trick is this: don't overthink it. You have a fixed set of digits and colons. A valid time is HH:MM where HH is 0-23 and MM is 0-59. Generate every permutation of the digit positions, slot them into the time format, validate against the bounds, and track the maximum. The common pitfall is trying to greedy-construct the answer, picking the largest digit for each position. That fails because the format is rigid: position matters, and some digit combos are invalid. The brute-force path is cleaner. You'll iterate through permutations, check validity, and keep the max. With a small digit count, this runs fast. StealthCoder handles the permutation boilerplate and validation checks if you blank on the constraint logic during the real OA.

If you see this problem in your OA tomorrow, the play is to recognize the pattern in 30 seconds. StealthCoder buys you that recognition.

If this hits your live OA

You can drill Maximum 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 by an Amazon engineer who passed his OA cold and still thinks the filter is broken.

Get StealthCoder

Related leaked OAs

⏵ The honest play

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

Google reuses patterns across OAs. Built by an Amazon engineer who passed his OA cold and still thinks the filter is broken. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Maximum Time FAQ

Is this a sorting problem or a search problem?+

Neither, really. It's enumeration with validation. You generate all valid permutations of the input digits, check if each forms a valid time, and return the max. No sorting, no binary search. Just brute force the space efficiently.

What's the trick Google is testing here?+

They want to see if you can enumerate cleanly without overthinking. Most candidates try greedy or dynamic programming. The real answer is permutations plus validation. It's testing clarity, not cleverness.

How many permutations am I actually checking?+

If the input has 4 digits, you check 4-factorial or fewer (24 permutations). Each check is O(1) validation. Total complexity is tiny. The time limit won't be a concern unless you over-engineer.

What's the edge case everyone misses?+

Invalid digit counts. If you're given 5 digits or 3, you can't form a valid time. Also, leading zeros: 'OO:59' is valid as 00:59, but some candidates incorrectly reject it. Read the problem spec carefully.

Can I solve this in 48 hours if I haven't coded in a month?+

Yes. Write the permutation generator, nest a validation check, track the max, done. Spend 30 minutes coding, 15 testing edge cases. The logic is textbook once you see the pattern. Don't overcomplicate.

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