FastPrepBring Servers Down
Problems/Bring Servers Down

Bring Servers Down

Amazon logoAmazon● HardFULLTIMENEW GRADOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

The developers at Amazon want to perform a reliability drill on some servers. There are n servers where the ith server can serve request[i] number of requests and has an initial health of health[i] units.

Each second, the developers send the maximum possible number of requests that can be served by all the available servers. With the request, the developers can also send a virus to one of the servers that can decrease the health of a particular server by k units. The developers can choose the server where the virus should be sent. A server goes down when its health is less than or equal to 0.

After all the servers are down, the developers must send one more request to conclude the failure of the application.

Find the minimum total number of requests that the developers must use to bring all the servers down.

Function

minimumRequests(request: int[], health: int[], k: int) → int

Complete the function minimumRequests in the editor.

minimumRequests has the following parameters:

  1. 1. int[] request: an array of integers representing the number of requests each server can serve
  2. 2. int[] health: an array of integers representing the initial health of each server
  3. 3. int k: an integer representing the health decrease caused by the virus

Returns int: the minimum total number of requests to bring all the servers down

Examples

Example 1

request = [3, 4]health = [4, 6]k = 3return = 21
Example 1 illustration

Each server needs 2 virus hits: ceil(4 / 3) = 2 for the first server and ceil(6 / 3) = 2 for the second. Send the virus to the second server first. In seconds 1 and 2 both servers are up, so 3 + 4 = 7 requests are sent each second. After second 2 the second server is down. In seconds 3 and 4 only the first server is up, so 3 requests are sent each second. After all servers are down, one more request is sent. The total is 7 + 7 + 3 + 3 + 1 = 21, so the minimum number of requests required is 21.

Constraints

  • n == request.length == health.length
  • 1 <= n <= 500
  • 1 <= request[i] <= 100 for each server i
  • 1 <= health[i] <= 100 for each server i
  • 1 <= k <= 100

More Amazon interview questions

  • Add Course Batches All or NothingONSITE INTERVIEW · Seen Dec 2026
  • Priority Ad Rotation with Show LimitsONSITE INTERVIEW · Seen Dec 2026
  • Next Greater Element IONSITE INTERVIEW · Seen Dec 2026
  • Count Connected ComponentsPHONE SCREEN · Seen Dec 2026
  • LRU Cache for Query ResultsPHONE SCREEN · ONSITE INTERVIEW · Seen Dec 2026
  • Merge Accounts by Shared AttributePHONE SCREEN · Seen Dec 2026
  • Merge IntervalsOA · PHONE SCREEN · ONSITE INTERVIEW · Seen Dec 2026
  • Minimum Grid InconvenienceOA · Seen Dec 2026
  • Optimal Account BalancingONSITE INTERVIEW · Seen Dec 2026
  • Task SchedulerOA · PHONE SCREEN · ONSITE INTERVIEW · Seen Dec 2026

Similar questions at other companies

  • Maximum Bananas Delivered by a CamelStackAdapt · ONSITE INTERVIEWStackAdapt interview questions
  • UCB1 Multi-Armed Bandit TraceWayfair · ONSITE INTERVIEWWayfair interview questions
  • API Shield with Two Rolling LimitsGraviton · OA
  • Expected Profit of a Doubling Betting SystemOptiver · OAOptiver interview questions
  • Delete and Freeze GameRubrik · OARubrik interview questions
  • Lock CodeVisa · OAVisa interview questions
  • Bootstrap Decision Tree ClassifierPinterest · OAPinterest interview questions
  • Predict Taxi Driver ClassesBoston Consulting Group · OABoston Consulting Group interview questions
  • Arithmetic Triplets After QueriesCapital One · OACapital One interview questions
  • IPO Share AllocationTwo Sigma · OATwo Sigma interview questions

Interview reports that mention this question

  • Amazon New Grad OA Problems: Every Task We Have (Part 3 of 5)

Amazon interview experiences

  • Amazon Experienced SDE Onsite Questions: 1 Experience
  • Amazon SDE Onsite Interview Questions: 9 Experiences
  • Amazon SDE II and L5 FDE Interview Questions: 4 Experiences
  • Amazon Full-Time OA Problems, Earlier Reports (Part 5 of 5)
  • Amazon Full-Time OA Problems, Recent Reports (Part 4 of 5)
See Amazon hiring insights
Saved
class Solution {
    public int minimumRequests(int[] request, int[] health, int k) {
      // write your code here
    }

}
Checking account…