Flower Bouquets
Reported by candidates from HSBC's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.
HSBC pulled this one in March 2025, and it's a classics problem dressed up in flowers. You're given bouquets with a certain number of flowers, a delivery deadline in days, and a required number of adjacent bouquets to pick each day. The trick: you must pick k consecutive bouquets every single day, and you need to finish m bouquets total by day d. No skipping, no flexibility. This is a binary search + sliding window problem hiding behind a flowers metaphor. StealthCoder can walk you through the validation logic if you freeze on the approach.
Pattern and pitfall
The core pattern is binary search on the answer. You binary search over the number of bouquets you can pick per day, then for each candidate rate, you simulate whether you can gather m flowers within d days by always picking k adjacent bouquets. The sliding window part is the simulation: iterate through the array, track consecutive bouquets of sufficient size, and count valid picks. The pitfall is confusing 'can I pick k consecutive' with 'do the k bouquets have enough flowers'. You need both conditions. Most candidates jump straight to greedy or a single pass. Binary search + validation is the cleaner path. If you blank on the structure during the OA, StealthCoder will prompt you toward the simulation check inside the binary search bounds.
Memorize the pattern. If you can't, run StealthCoder. The proctor sees the IDE. They don't see what's behind it.
You can drill Flower Bouquets 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 StealthCoderRelated leaked OAs
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.
You've seen the question.
Make sure you actually pass HSBC's OA.
HSBC 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.
Flower Bouquets FAQ
Do I need to pick exactly k bouquets or at least k?+
Exactly k, and they must be consecutive. Every day you pick k adjacent bouquets from the array, no gaps. That adjacency constraint is what makes the sliding window part necessary.
Is this really a binary search problem?+
Yes. You're searching for the minimum bouquets per day you can pick and still finish m bouquets by day d. For each candidate answer, you validate with a greedy simulation. That validation is the harder part, not the binary search itself.
What's the gotcha HSBC candidates miss?+
Thinking they can pick bouquets non-consecutively or skip days. The problem forces you to pick exactly k consecutive bouquets every single day until you hit m or run out of time. The greedy simulation has to respect that.
How do I validate whether a given rate works?+
Iterate through the bouquet array. Each day, find the first k consecutive bouquets where the minimum flower count is at least your candidate rate. If found, consume them and increment the day counter. If you hit m bouquets before running out of days, the rate is valid.
Should I memorize this pattern for other OAs?+
Binary search on the answer plus a feasibility check is common for capacity and delivery problems across companies. HSBC and similar firms reuse it. If you see a deadline and a rate, think binary search first.