Skip to main content
All Questions

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

Software Engineering Interview Prep

Land your dream software engineering role at Google, Amazon, Microsoft, Meta, Apple, and other top companies. Learn from mock interviews, frameworks, and advice from senior candidates—practice data structures, algorithms, system design, people management, behavioral interviews, and more.

Course

System Design Interviews

Learn how to answer the latest system design questions across product, infrastructure, and AI domains. Features in-depth video examples, written breakdowns, and helpful reference patterns. Watch senior engineers and managers answer these questions in mock interview videos.