ZS Associates Interview Question

Design an elevator algorithm