Summary
Interviewed for a Software Engineer position at Gojek for their LLD round. The focus was on designing a system for managing air traffic control with runways and planes. The candidate was asked to create functions for handling different airplane actions and maintain data structures for efficient processing.
Full Experience
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.
Interview Questions (1)
Design a system to manage air traffic control at an airport with multiple runways and planes. The system must handle different airplane actions such as takeoff, land, dock, and undock. The task is to create functions that assign runways to incoming requests based on first come first serve basis.