One of the interview questions asked is “Elevator Algorithm”. As you think this problem seems easy, but you might not be easily think of the algorithm in a fast manner. I have written a simple version of it and I think this would be enough for an interview.
This class is the core class that nearly all of the logic runs, so it will be enough for you to view this thorough.
This class is the engine that will simulate the work of an elevator using the thread mechanism.
The driver classs to test the algorithm.