Server Investment

Problem Overview

  • Compute the maximum number of upgraded servers for each network site.
  • Input: arrays num_servers, money, sell, upgrade (length n); Output: int[] of size n with per-site maxima; constraints up to 1e5 items and values up to 1e4.
  • Context: a network security administrator balances upgrading servers and selling servers to fund security.
  • This Snowflake interviews coding interview problem is a practical interview question on resource allocation.

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Input Variables
Execution Result: