Company: Goldman Sachs OA

Difficulty: medium

Problem Statement

2. Car Wash Relay A car-wash facility runs N wash stations arranged one after another along a single track, and M vehicles must pass through them in order, from vehicle 1 through vehicle M . Each vehicle also visits the stations strictly in order, from station 1 through station N , before it is considered clean. Every vehicle carries a soiling level F . Each station has a base service duration T needed to clean one unit of soiling, so station i spends T i F j minutes on vehicle j . A vehicle can only move to the next station the instant the current station releases it - there is no room to wait between stations, and a station cannot begin work on the next vehicle in the queue until it has finished with the current one. Because of this, the moment each vehicle is allowed to enter station 1 must be chosen carefully so that every station is free exactly when it needs to receive that vehicle. Write a program that computes the earliest possible moment at which the last vehicle can finish at

More Goldman Sachs OA OA questionsInterview experiences