IPO
Reported by candidates from Tekion's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.
Tekion reported this one in September 2026, and the input size tells you the whole story: up to 10^5 projects and k up to 10^5 means rescanning every project for each pick is dead on arrival. This is IPO, a greedy problem with a heap and a sort behind it. You have a starting capital, a pile of projects with entry thresholds, and a pick limit. If you've seen it, it's ten minutes. If you haven't, the trap is easy to fall into. StealthCoder is the safety net if you blank during the live assessment, but the pattern is short enough to carry in your head.
The problem
You are given n projects. Project i produces a pure profit of profits[i] and requires at least capital[i] current capital before it can be started. You begin with capital w. A project's capital requirement is only an eligibility threshold; it is not spent. After completing a project, immediately add its profit to your capital. Each project may be completed at most once. Choose at most k distinct projects to maximize your final capital. Return that maximum final capital. Function findMaximizedCapital(k: int, w: int, profits: int[], capital: int[]) → int Examples Example 1 k = 2 w = 0 profits = [1,2,3] capital = [0,1,1] return = 4 Complete project 0 to grow capital from 0 to 1. Projects 1 and 2 then become affordable; choosing project 2 produces final capital 4. Example 2 k = 3 w = 0 profits = [1,2,3] capital = [1,1,2] return = 0 No project is affordable with initial capital 0, so the final capital remains 0. Constraints 1 <= profits.length = capital.length <= 10^5 1 <= k <= profits.length 0 <= w <= 10^9 0 <= profits[i] <= 10^9 0 <= capital[i] <= 10^9 The maximum final capital fits in a signed 32-bit integer.
Reported by candidates. Source: FastPrep
Pattern and pitfall
The trick: at every step, among projects you can afford, take the one with the biggest profit. Profit only grows your capital, so greedy is safe. Sort projects by capital requirement. Keep a pointer into that sorted list and a max-heap of profits. Each of up to k rounds, push every project whose capital is now <= w onto the heap, then pop the largest profit and add it to w. If the heap is empty, stop early, since nothing else unlocks. That's O(n log n) total. Common pitfalls: subtracting capital as if it were spent (it's only a threshold), forgetting to break when the heap is empty, and using a min-heap by mistake. Example 2 is the edge case: nothing is affordable at w = 0, so you return 0. If your mind goes blank on the live OA, StealthCoder can surface this sort plus heap structure quickly.
If this hits your live OA and you blank, StealthCoder solves it in seconds, invisible to the proctor.
You can drill IPO 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 would have shipped this the night before his JPMorgan OA if he'd had it.
Get StealthCoderRelated leaked OAs
This OA pattern shows up on LeetCode as ipo. If you have time before the OA, drill that.
You've seen the question.
Make sure you actually pass Tekion's OA.
Tekion reuses patterns across OAs. Built by an Amazon engineer who would have shipped this the night before his JPMorgan OA if he'd had it. Works on HackerRank, CodeSignal, CoderPad, and Karat.
IPO FAQ
What's the trick in the Tekion IPO problem?+
Greedy with a max-heap. Sort projects by required capital, unlock everything affordable into a max-heap of profits, then pick the largest profit each round. Repeat up to k times. Picking the biggest affordable profit never hurts because capital only increases.
Why does brute force fail here?+
With n up to 10^5 and k up to 10^5, scanning all projects for every pick is about 10^10 operations. You need sorting plus a heap to get O(n log n). Anything quadratic will time out on the larger tests.
What edge cases should I test?+
Test when no project is affordable at the start, like example 2 where the answer stays at w. Also test k larger than the number of affordable projects, projects with zero profit, and many projects sharing the same capital requirement. Break out of the loop when the heap is empty.
Is capital spent when I start a project?+
No. The capital value is only an eligibility threshold. You never subtract it. You just add the profit after finishing. Mixing this up is the most common wrong answer on this problem.
How do I prepare for this in 48 hours?+
Write the solution once from scratch: sort by capital, pointer plus max-heap, loop k times. Then run both examples by hand. Also review one other heap-and-greedy problem so the pattern feels familiar. That's enough for this one.