GOLDMAN SACHS Technology Analyst OA (2023) | Investment Portfolio Optimization | Greedy and Priority Queue Solution

GoldmanSachs · Question · Posted Jun 2026

Investment Portfolio Growth Problem Statement A financial firm has identified multiple investment opportunities. Each investment: Requires a minimum amount of capital to start. Generates a profit after completion. You are given: k → maximum number of investments that can be selected. w → initial capital. profits[i] → profit earned from investment i. capital[i] → minimum capital required for investment i. Your task is to maximize the final capital after completing at most k investments. Example Input k = 2 initialCapital ...

The full answer & interview discussion are available to premium members.

Log in Create a free account