ashishps1 / awesome-low-level-design

Learn Low Level Design (LLD) and prepare for interviews using free resources.
https://blog.algomaster.io
GNU General Public License v3.0
6.76k stars 1.85k forks source link

Only one Elevator would be accepting all the request. #24

Open viveksinghvats opened 1 month ago

viveksinghvats commented 1 month ago

https://github.com/ashishps1/awesome-low-level-design/tree/main/solutions/java/src/elevatorsystem

In the current Elevator LLD implementation, I identified an issue where, during elevator requests in the main function, Elevator1 ends up accepting all the requests. As a result, when the code is executed, only Elevator1 moves and handles all the requests, while the other elevators remain idle.

annubv commented 1 week ago

Identified the same issue, seems like elevators are not processing any request, since there is no console output for elevator movement:

print(f"Elevator {self.id} reached floor {self.current_floor}")

Edit: This for the python code btw, just noticed the issue is opened for java implementation.