Pick Launches to Maximize Capital With at Most K Projects
Last updated: November 29, 2026
Quick Overview
Each project needs a minimum capital to start and returns a pure profit added to your capital. Starting with capital w, you may complete at most k projects one after another. Return the maximum final capital.
0
0
0 solved
Each project needs a minimum capital to start and returns a pure profit added to your capital. Starting with capital w, you may complete at most k projects one after another. Return the maximum final capital.
A Google onsite greedy question in a product-launch funding frame, often used to test the two-heap unlock pattern. The interviewer wants projects sorted by required capital and a max-heap of profits for everything currently affordable.
What the Interviewer Expects
- Sorts projects by required capital
- Unlocks affordable projects into a max-heap of profits
- Picks the largest profit each round
- Stops early when nothing is affordable
- Justifies greedy since capital only grows
Key Topics to Cover
How to Approach This
- Clarify input constraints and edge cases before writing code.
- Walk through your approach verbally and confirm with the interviewer before coding.
- Start with a brute force solution, then optimize. Mention time and space complexity.
- Test your solution with examples, including edge cases like empty input or duplicates.
- Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
- What if projects can lose money?
- What if projects run in parallel with a team limit?
- Return the chosen projects
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
- Input: k, initial capital w, lists
profitsandcapitalof length n. - A project is startable when current capital >= its requirement; finishing adds its profit (non-negative).
- Output: maximum ...
High-Level Design
Profits are non-negative, so capital never decreases, and any project affordable now stays affordable. That makes the greedy clean: at each step, among all affordable projects, take the one with the l...