Gojek | Software Engineer | LLD Round
Anonymous User
561

Suppose you are managing an Air Traffic control system at an airport.

You have requests coming in from Airplanes to land and takeoff.

Assume you have multiple runways and multiple planes wanting to takeoff/land utilizing these runways. One runway can only be used by one plane at a time.Your task is to assign runways to incoming requests from airplanes. Consider assigning runways on first come first serve basis.Create functions that accept the airplane id and actiontype(takeoff,land,dock,undock) as parameters and assigns runways to planes.

Takeoff = plane already on runway and is now taking off.
Land = plane in air and is approaching to land.
Dock = plane has landed and now wants to dock in the hanger.
Undock = plane in the hanger, wants to undock and use a runway to takeoff.

Maintain this data in appropriate data structure for fast processing. Also, persist this data in a datastore.

Comments (2)