Design Aeroplane Landing Scheduling System

Difficulty: MEDIUMCategory: LLDFrequency: 1Asked On 2024-06-25

Problem Statement

Designing an Aeroplane Landing Scheduling System for an airport. The airport has multiple runways and incoming flights that need to be scheduled for landing based on priority, availability, and safety constraints.


The system should ensure fairness, efficiency, and safety while scheduling planes.


Functional Requirements


1.Flight Registration
•Flights notify the airport system of their arrival (ETA, airline, fuel left, emergency status).
•System must register flights and keep them in a waiting queue until assigned a runway.
2.Runway Scheduling
•Assign flights to runways based on:
•Priority (emergency landings > low fuel > regular flights).
•ETA / first-come-first-serve ordering for flights of same priority.
•Support multiple runways with different capacity constraints.
•Ensure minimum separation time between landings on the same runway.
3.Conflict Handling
•Handle cases where multiple flights request landing simultaneously.
•Allow rescheduling if emergencies arise (e.g., preempt a regular flight).
4.Monitoring & Notifications
•Notify Air Traffic Controllers (ATC) about assigned runway and landing time.
•Update flight status: waiting → scheduled → landed.
5.Dynamic Updates
•Support real-time updates (delays, diversions, emergencies).
•Re-run scheduling when conditions change.


Non-Functional Requirements


•Thread Safety: Multiple concurrent flight requests must be handled safely.
•Scalability: Should handle thousands of flights per day.
•Low Latency: Assignments should be computed quickly (<100 ms).
•Fault Tolerance: No data loss in case of crash; logs for recovery.
•Extensibility: Should support new rules (e.g., weather-based scheduling).


Design Constraints & Edge Cases


•Two planes requesting the same runway at the same time → system must enforce separation buffer.
•Emergency landings must preempt already scheduled flights.
•Flights may divert (must be removed from queue).
•System crash should not lose the state of scheduled flights.


Design Hints


•Data Structures:
•Use a Priority Queue for waiting flights (ordered by priority + ETA).
•Maintain Runway Schedules as a time-ordered structure (e.g., min-heap or sorted list).
•Key Classes / Interfaces:
•Flight → (id, airline, ETA, fuelLeft, emergencyFlag, status).
•Runway → (id, availabilityTime, assignedFlights).
•Scheduler → decides which flight gets which runway.
•LandingRequest → flight + metadata.
•ScheduleManager → manages conflicts, updates, notifications.
•Design Patterns:
•Observer Pattern → Notify ATC and flights when schedules change.
•Strategy Pattern → Different scheduling strategies (priority-based, fairness-based, fuel-based).
•Singleton → Central Scheduler service.


Example Flow


1.Flights A, B, C request landing:
•A (ETA=10:05, normal)
•B (ETA=10:03, emergency)
•C (ETA=10:04, low fuel)
2.Priority Queue orders: B > C > A.
3.Scheduler assigns:
•Runway 1 → Flight B at 10:03
•Runway 2 → Flight C at 10:04
•Runway 1 → Flight A at 10:08 (with 3-min separation buffer)
4.ATC notified of assignments.
5.Flight D (emergency at 10:06) arrives → preempts Flight A → reschedules A later.


Evaluation Areas


•Designing flight + runway data models.
•Implementing priority scheduling with preemption.
•Handling thread safety for concurrent requests.
•Clean abstractions for scheduling policies.


👉 This LLD problem tests priority queues, scheduling algorithms, concurrency control, and clean extensible design (real-world Air Traffic Control analogy).

Solution

Comments