You are given two collections describing a company's current vehicle fleet and its target vehicle fleet.
Each record has the format:
VehicleModel,FleetType,Quantity
A vehicle model can belong to either ACTIVE or RESERVE, and the same model may appear in both fleet types. For example, a company could have both active and reserve Ford Transit vans. These should be treated as separate records.
Write a program that determines the changes required to make the current fleet match the target fleet.
If the target quantity is greater than the current quantity, output an ADD action. If the target quantity is lower than the current quantity, output a REMOVE action. If the quantities are equal, no action is required.
The current fleet and target fleet are supplied in a single string separated by :. Individual records are separated by |
For example:
Ford Transit,ACTIVE,10|Mercedes Sprinter,ACTIVE,15|Toyota Hilux,RESERVE,5
The required output would be:
ADD,Ford Transit,ACTIVE,5 REMOVE,Mercedes Sprinter,ACTIVE,5
Each output line should use the format:
Action,VehicleModel,FleetType,Quantity
The results must be sorted alphabetically by vehicle model. If the same vehicle model appears as both ACTIVE and RESERVE, list the ACTIVE record first.
Quantities may be positive decimal values, and there will always be at least one vehicle in both the current and target fleet.
The following metrics were computed from 1 interview experience for the BlackRock Vice President Technology role in London, United Kingdom.
BlackRock's interview process for their Vice President Technology roles in London, United Kingdom is extremely selective, failing the vast majority of engineers.
Candidates reported having very negative feelings for BlackRock's Vice President Technology interview process in London, United Kingdom.