Fulfill a stream of (quantity, city) requests from the nearest distribution center with capacity.
Unlock detailed company stats for this questionUpgrade
Given distribution centers DC = ["DC1", "DC2", "DC3"] with Capacity = [50, 50, 50], a stream of requests arrives, each a (quantity, cityName) pair, e.g. (8, Delhi), (10, Kolkata), (5, Bangalore). Each request should be fulfilled by the nearest DC to the requested city, considering the DC's available capacity.
The requirement was ambiguous: no latitude/longitude, distance matrix, predefined mapping or API was provided for the cities or DCs, so it was unclear how to determine which DC is nearest to a given city.
Format · Technical interview.
Community answers
No answers contributed by the community yet.
Related courses

Course

Course
Course
