Reported February 2024
Googlebinary search

Min Days to Bloom

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

You've got a Google OA coming up and Min Days to Bloom just landed on the live assessment circuit in February. This is a search problem disguised as a simulation. The trap is overthinking it as a greedy or dynamic-programming puzzle when binary search on the answer is the real move. You'll need to verify feasibility at each candidate day count, which means understanding how plants propagate or bloom under constraints. StealthCoder will catch you if you blank on the feasibility check logic during the live OA.

Pattern and pitfall

Min Days to Bloom is a classic 'minimize the maximum' or 'find the first day X where Y is possible' pattern. You binary search on the number of days, then for each midpoint, simulate whether all plants can bloom by that day given the growth or bloom rules. The feasibility function is the core: it typically involves checking if adjacent plants can trigger each other or if some threshold of days allows a cascade. Common mistakes are simulating greedily forward instead of checking all constraints, or misunderstanding the bloom trigger conditions. The pattern is binary search plus simulation. StealthCoder's real value here is the live feasibility logic if you draw a blank under time pressure.

StealthCoder is the hedge for the one pattern you didn't drill. It runs invisibly during the screen share.

If this hits your live OA

You can drill Min Days to Bloom 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. If you're reading this with an OA window open, you're who this was built for.

Get StealthCoder

Related leaked OAs

⏵ Practice the LeetCode equivalent

This OA pattern shows up on LeetCode as minimum number of days to make m bouquets. 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. If you're reading this with an OA window open, you're who this was built for. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Min Days to Bloom FAQ

Is this actually binary search or something else?+

It's binary search on days with a feasibility check baked in. You'll search between 1 and some large day count, then simulate whether the bloom conditions are met by that day. That simulation is where the logic lives.

What's the feasibility check really doing?+

It simulates whether all plants can bloom within X days. Usually plants trigger bloom in neighbors, or you need enough time for a spreading effect. You iterate day by day (or use math to jump) and track which plants are blooming.

How do I prepare for this in 48 hours if I've never seen it?+

Understand binary search on answers first. Then code a simple forward simulation: start with one bloomed plant, see how many days it takes to reach all plants. The answer is the minimum days that simulation succeeds.

Will this timeout if I simulate naively?+

Depends on constraints, but usually no if you binary search properly. You make O(log N) feasibility calls, each O(N) or O(N log N). Total is fast. Avoid simulating every single day from 1 to the answer.

What if plants bloom in a weird pattern or there's a special rule?+

The feasibility function changes, but the search structure stays the same. Read the problem text carefully for bloom triggers, distance rules, or growth rates. That becomes your simulation logic.

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