FastPrepIPO
Problems/IPO

IPO

The D.E. Shaw Group logoThe D.E. Shaw Group● HardFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: In a long D. E. Shaw round with two coding questions, a concurrency question and a Java question, the second coding question was IPO, named directly.

The report gives no examples, limits or changes to the usual task. Here you get the standard version: start with some capital, finish at most k projects whose required capital you can meet, and return the largest final capital. The limits are added for our version.

Our version is about 90% the same as the reported question.

A company wants to finish some projects before it goes public. It starts with capital w and can finish at most k different projects, one after another.

Project i can be started only when the current capital is at least capital[i]. Starting it does not use up any capital. When it is finished, its pure profit profits[i] is added to the capital. Each project can be done at most once.

Choose the projects and their order to make the final capital as large as possible, and return that final capital.

Function

findMaximizedCapital(k: int, w: int, profits: int[], capital: int[]) → int

Examples

Example 1

k = 3w = 1profits = [2,5,1,3]capital = [1,4,0,2]return = 11

With capital 1, the projects needing 1 and 0 can start. Take the one with profit 2, so capital becomes 3. Now the project needing 2 can start too; take its profit 3, so capital becomes 6. Now the project needing 4 can start; take its profit 5. The final capital is 11.

Example 2

k = 3w = 0profits = [1,2,3]capital = [1,1,2]return = 0

Every project needs at least 1 capital, but the company has 0. No project can ever start, so the capital stays 0.

Example 3

k = 1w = 5profits = [4,9,2]capital = [5,6,0]return = 9

Only one project may be done. With capital 5, the projects needing 5 and 0 can start, but not the one needing 6. The best is profit 4, so the final capital is 9.

Constraints

  • 1 <= k <= 10^5
  • 0 <= w <= 10^9
  • n == profits.length == capital.length
  • 1 <= n <= 10^5
  • 0 <= profits[i] <= 10^4
  • 0 <= capital[i] <= 10^9
  • The answer fits in a 32-bit signed integer.

More The D.E. Shaw Group interview questions

  • Print Numbers in Turn with Three ThreadsPHONE SCREEN · Seen Nov 2026
  • Subarray Product Less Than KPHONE SCREEN · Seen Nov 2026
  • Koko Eating BananasPHONE SCREEN · Seen Nov 2026
  • Sum of Smallest Non-DivisorsPHONE SCREEN · Seen Nov 2026
  • Remove the Fewest Magic BeansPHONE SCREEN · Seen Oct 2026
  • Equal-Weight Portfolio VariancePHONE SCREEN · Seen Oct 2026
  • Count Distinct Rooted-Tree GraftsPHONE SCREEN · Seen Oct 2026
  • Decode WaysPHONE SCREEN · Seen Sep 2026
  • Maximum L1 Distance Between Equal-Length SubarraysPHONE SCREEN · Seen Jul 2026
  • Count Lucky TicketsOA · Seen Nov 2026

Similar questions at other companies

  • IPOTekion · PHONE SCREENTekion interview questions
  • IPOInMobi · PHONE SCREENInMobi interview questions
  • Lexicographically Smallest Array with K-Limited Right MovesGoogle · PHONE SCREENGoogle interview questions
  • Minimum Refueling StopsBloomberg LP · PHONE SCREENBloomberg LP interview questions
  • Tennis Court SchedulingAtlassian · PHONE SCREEN · ONSITE INTERVIEWAtlassian interview questions
  • Maximum Number of Events That Can Be AttendedByteDance · PHONE SCREENByteDance interview questions
  • Minimum Bus Fleet Across StationsSnowflake · PHONE SCREENSnowflake interview questions
  • Schedule Unit-Time Jobs for the Most ProfitScale AI · PHONE SCREENScale AI interview questions
  • Minimum Meeting RoomsSentry · PHONE SCREENSentry interview questions
  • Minimum Refueling StopsUber · ONSITE INTERVIEWUber interview questions
All The D.E. Shaw Group interview questionsSee The D.E. Shaw Group hiring insights
Saved
class Solution {
    public int findMaximizedCapital(int k, int w, int[] profits, int[] capital) {
        // Write your code here.
    }
}
Checking account…